From ed6b19fef007db70a78016c1738776d3fa67642a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 25 Apr 2023 04:25:28 +0000 Subject: [PATCH] fix(deps): update github.com/containers/common digest to 46c4463 Signed-off-by: Renovate Bot --- go.mod | 2 +- go.sum | 4 ++-- .../common/pkg/sysinfo/numcpu_linux.go | 24 +++++-------------- vendor/modules.txt | 2 +- 4 files changed, 10 insertions(+), 22 deletions(-) diff --git a/go.mod b/go.mod index 004e9e9857..ff9d2d212c 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/containernetworking/cni v1.1.2 github.com/containernetworking/plugins v1.2.0 github.com/containers/buildah v1.30.0 - github.com/containers/common v0.52.1-0.20230421100625-554799639fc8 + github.com/containers/common v0.52.1-0.20230424070932-46c446398f30 github.com/containers/conmon v2.0.20+incompatible github.com/containers/image/v5 v5.25.0 github.com/containers/libhvee v0.0.5 diff --git a/go.sum b/go.sum index 9848f20e32..b5c034c058 100644 --- a/go.sum +++ b/go.sum @@ -239,8 +239,8 @@ github.com/containernetworking/plugins v1.2.0 h1:SWgg3dQG1yzUo4d9iD8cwSVh1VqI+bP github.com/containernetworking/plugins v1.2.0/go.mod h1:/VjX4uHecW5vVimFa1wkG4s+r/s9qIfPdqlLF4TW8c4= github.com/containers/buildah v1.30.0 h1:mdp2COGKFFEZNEGP8VZ5ITuUFVNPFoH+iK2sSesNfTA= github.com/containers/buildah v1.30.0/go.mod h1:lyMLZIevpAa6zSzjRl7z4lFJMCMQLFjfo56YIefaB/U= -github.com/containers/common v0.52.1-0.20230421100625-554799639fc8 h1:W3SNyracX5Lhnvg5gI0oLT68247HOE5vpt5J9h/FAC8= -github.com/containers/common v0.52.1-0.20230421100625-554799639fc8/go.mod h1:pABPxJwlTE8oYk9/2BW0e0mumkuhJHIPsABHTGRXN3w= +github.com/containers/common v0.52.1-0.20230424070932-46c446398f30 h1:2HUDH+YRnT214PTxLvnyawyDl4iMmtu0pxCN63F2jG4= +github.com/containers/common v0.52.1-0.20230424070932-46c446398f30/go.mod h1:pABPxJwlTE8oYk9/2BW0e0mumkuhJHIPsABHTGRXN3w= github.com/containers/conmon v2.0.20+incompatible h1:YbCVSFSCqFjjVwHTPINGdMX1F6JXHGTUje2ZYobNrkg= github.com/containers/conmon v2.0.20+incompatible/go.mod h1:hgwZ2mtuDrppv78a/cOBNiCm6O0UMWGx1mu7P00nu5I= github.com/containers/image/v5 v5.25.0 h1:TJ0unmalbU+scd0i3Txap2wjGsAnv06MSCwgn6bsizk= diff --git a/vendor/github.com/containers/common/pkg/sysinfo/numcpu_linux.go b/vendor/github.com/containers/common/pkg/sysinfo/numcpu_linux.go index d2245a9417..c10d69c79c 100644 --- a/vendor/github.com/containers/common/pkg/sysinfo/numcpu_linux.go +++ b/vendor/github.com/containers/common/pkg/sysinfo/numcpu_linux.go @@ -3,11 +3,7 @@ package sysinfo -import ( - "unsafe" - - "golang.org/x/sys/unix" -) +import "golang.org/x/sys/unix" // numCPU queries the system for the count of threads available // for use to this process. @@ -16,20 +12,12 @@ import ( // 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.RawSyscall(unix.SYS_GETPID, 0, 0, 0) + pid := unix.Getpid() - var mask [1024 / 64]uintptr - _, _, err := unix.RawSyscall(unix.SYS_SCHED_GETAFFINITY, pid, uintptr(len(mask)*8), uintptr(unsafe.Pointer(&mask[0]))) - if err != 0 { + var mask unix.CPUSet + err := unix.SchedGetaffinity(pid, &mask) + if err != nil { return 0 } - // For every available thread a bit is set in the mask. - ncpu := 0 - for _, e := range mask { - if e == 0 { - continue - } - ncpu += int(popcnt(uint64(e))) - } - return ncpu + return mask.Count() } diff --git a/vendor/modules.txt b/vendor/modules.txt index 812c77c859..b0f83d304b 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -125,7 +125,7 @@ github.com/containers/buildah/pkg/rusage github.com/containers/buildah/pkg/sshagent github.com/containers/buildah/pkg/util github.com/containers/buildah/util -# github.com/containers/common v0.52.1-0.20230421100625-554799639fc8 +# github.com/containers/common v0.52.1-0.20230424070932-46c446398f30 ## explicit; go 1.18 github.com/containers/common/libimage github.com/containers/common/libimage/define