fix(deps): update github.com/containers/common digest to 46c4463

Signed-off-by: Renovate Bot <bot@renovateapp.com>
This commit is contained in:
renovate[bot]
2023-04-25 04:25:28 +00:00
committed by GitHub
parent 3ecb174eee
commit ed6b19fef0
4 changed files with 10 additions and 22 deletions

2
go.mod
View File

@ -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

4
go.sum
View File

@ -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=

View File

@ -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()
}

2
vendor/modules.txt vendored
View File

@ -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