moby/pkg/sysinfo
Tobias Klauser 4ec063fade
pkg/sysinfo: omit Getpid call in numCPU
The man page for sched_setaffinity(2) states the following about the pid
argument [1]:

> If pid is zero, then the mask of the calling thread is returned.

Thus the additional call to unix.Getpid can be omitted and pid = 0
passed to unix.SchedGetaffinity.

[1] https://man7.org/linux/man-pages/man2/sched_setaffinity.2.html#DESCRIPTION

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
2023-04-25 10:05:20 +02:00
..
cgroup2_linux.go vendor: github.com/containerd/cgroups/v3 v3.0.1 2023-03-08 20:15:17 +09:00
numcpu.go pkg/sysinfo: unify NumCPU implementation 2022-12-21 10:53:42 +01:00
numcpu_linux.go pkg/sysinfo: omit Getpid call in numCPU 2023-04-25 10:05:20 +02:00
numcpu_other.go pkg/sysinfo: unify NumCPU implementation 2022-12-21 10:53:42 +01:00
numcpu_windows.go pkg/sysinfo: unify NumCPU implementation 2022-12-21 10:53:42 +01:00
sysinfo.go pkg: replace some README's with GoDoc package descriptions 2022-09-30 17:11:37 +02:00
sysinfo_linux.go vendor: github.com/containerd/cgroups/v3 v3.0.1 2023-03-08 20:15:17 +09:00
sysinfo_linux_test.go pkg/*: fix "empty-lines" (revive) 2022-09-28 01:58:49 +02:00
sysinfo_other.go Update to Go 1.17.0, and gofmt with Go 1.17 2021-08-24 23:33:27 +02:00
sysinfo_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00