mirror of
https://github.com/containers/podman.git
synced 2025-09-28 01:04:28 +08:00
Update to the latest version of buildah
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
20
vendor/github.com/containers/buildah/util/util_linux.go
generated
vendored
Normal file
20
vendor/github.com/containers/buildah/util/util_linux.go
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
// IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
|
||||
func IsCgroup2UnifiedMode() (bool, error) {
|
||||
isUnifiedOnce.Do(func() {
|
||||
var st syscall.Statfs_t
|
||||
if err := syscall.Statfs("/sys/fs/cgroup", &st); err != nil {
|
||||
isUnified, isUnifiedErr = false, err
|
||||
} else {
|
||||
isUnified, isUnifiedErr = st.Type == unix.CGROUP2_SUPER_MAGIC, nil
|
||||
}
|
||||
})
|
||||
return isUnified, isUnifiedErr
|
||||
}
|
Reference in New Issue
Block a user