Documentation ¶
Index ¶
- Constants
- func CreateUnixSocket(path string) (net.Listener, error)
- func EpollCreate1(flag int) (int, error)
- func EpollCtl(epfd int, op int, fd int, event *unix.EpollEvent) error
- func EpollWait(epfd int, events []unix.EpollEvent, msec int) (int, error)
- func FMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data string) error
- func ForceRemoveAll(path string) error
- func GetLocalListener(path string, uid, gid int) (net.Listener, error)
- func GetOOMScoreAdj(pid int) (int, error)
- func GetOpenFds(pid int) (int, error)
- func GetSubreaper() (int, error)
- func GetSystemCPUUsage() (uint64, error)
- func IsFifo(path string) (bool, error)
- func MkdirAllWithACL(path string, perm os.FileMode) error
- func RunningPrivileged() bool
- func RunningUnprivileged() bool
- func SetOOMScore(pid, score int) error
- func SetSubreaper(i int) error
- func StatATimeAsTime(st *syscall.Stat_t) time.Time
- func StatAtime(st *syscall.Stat_t) syscall.Timespec
- func StatCtime(st *syscall.Stat_t) syscall.Timespec
- func StatMtime(st *syscall.Stat_t) syscall.Timespec
- type Exit
Constants ¶
const OOMScoreMaxKillable = -999
OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
Variables ¶
This section is empty.
Functions ¶
func CreateUnixSocket ¶
CreateUnixSocket creates a unix socket and returns the listener
func EpollCreate1 ¶
EpollCreate1 directly calls unix.EpollCreate1
func ForceRemoveAll ¶ added in v1.1.0
ForceRemoveAll on unix is just a wrapper for os.RemoveAll
func GetLocalListener ¶
GetLocalListener returns a listener out of a unix socket.
func GetOOMScoreAdj ¶ added in v1.3.0
GetOOMScoreAdj gets the oom score for a process
func GetOpenFds ¶
GetOpenFds returns the number of open fds for the process provided by pid
func GetSubreaper ¶
GetSubreaper returns the subreaper setting for the calling process
func GetSystemCPUUsage ¶
GetSystemCPUUsage returns the host system's cpu usage in nanoseconds. An error is returned if the format of the underlying file does not match.
Uses /proc/stat defined by POSIX. Looks for the cpu statistics line and then sums up the first seven fields provided. See `man 5 proc` for details on specific field information.
func IsFifo ¶ added in v1.3.4
IsFifo checks if a file is a (named pipe) fifo if the file does not exist then it returns false
func MkdirAllWithACL ¶ added in v1.3.0
MkdirAllWithACL is a wrapper for os.MkdirAll on Unix systems.
func RunningPrivileged ¶ added in v1.1.4
func RunningPrivileged() bool
RunningPrivileged returns true if the effective user ID of the calling process is 0
func RunningUnprivileged ¶ added in v1.1.4
func RunningUnprivileged() bool
RunningUnprivileged returns true if the effective user ID of the calling process is not 0
func SetOOMScore ¶
SetOOMScore sets the oom score for the provided pid
func SetSubreaper ¶
SetSubreaper sets the value i as the subreaper setting for the calling process
func StatATimeAsTime ¶ added in v1.1.0
StatATimeAsTime returns st.Atim as a time.Time