history: correctly set tags

Requires vendoring fixes from c/common and to update the transformation
code.  Also add a test to avoid future regressions.

Fixes: #17763
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2023-05-02 13:57:43 +02:00
parent 91da62d74c
commit 9e9bcec9ec
9 changed files with 24 additions and 19 deletions

View File

@@ -8,14 +8,11 @@ import "golang.org/x/sys/unix"
// numCPU queries the system for the count of threads available
// for use to this process.
//
// Issues two syscalls.
// Returns 0 on errors. Use |runtime.NumCPU| in that case.
func numCPU() int {
// Gets the affinity mask for a process: The very one invoking this function.
pid := unix.Getpid()
var mask unix.CPUSet
err := unix.SchedGetaffinity(pid, &mask)
err := unix.SchedGetaffinity(0, &mask)
if err != nil {
return 0
}