File tree Expand file tree Collapse file tree 2 files changed +0
-23
lines changed Expand file tree Collapse file tree 2 files changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import (
1313 "path/filepath"
1414 "strconv"
1515 "strings"
16- "sync"
1716 "syscall"
1817 "time"
1918
3130 // ErrCgroupDeleted means the cgroup was deleted.
3231 ErrCgroupDeleted = errors .New ("cgroup deleted" )
3332 ErrStatCgroup = errors .New ("no cgroup available for gathering user statistics" )
34-
35- isUnifiedOnce sync.Once
36- isUnified bool
37- isUnifiedErr error
3833)
3934
4035// CgroupControl controls a cgroup hierarchy.
@@ -605,19 +600,6 @@ func SystemCPUUsage() (uint64, error) {
605600 return total , nil
606601}
607602
608- // IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
609- func IsCgroup2UnifiedMode () (bool , error ) {
610- isUnifiedOnce .Do (func () {
611- var st syscall.Statfs_t
612- if err := syscall .Statfs ("/sys/fs/cgroup" , & st ); err != nil {
613- isUnified , isUnifiedErr = false , err
614- } else {
615- isUnified , isUnifiedErr = st .Type == unix .CGROUP2_SUPER_MAGIC , nil
616- }
617- })
618- return isUnified , isUnifiedErr
619- }
620-
621603// UserConnection returns an user connection to D-BUS.
622604func UserConnection (uid int ) (* systemdDbus.Conn , error ) {
623605 return systemdDbus .NewConnection (func () (* dbus.Conn , error ) {
Original file line number Diff line number Diff line change 22
33package cgroups
44
5- // IsCgroup2UnifiedMode returns whether we are running in cgroup 2 cgroup2 mode.
6- func IsCgroup2UnifiedMode () (bool , error ) {
7- return false , nil
8- }
9-
105// UserOwnsCurrentSystemdCgroup checks whether the current EUID owns the
116// current cgroup.
127func UserOwnsCurrentSystemdCgroup () (bool , error ) {
You can’t perform that action at this time.
0 commit comments