package sys
import "github.com/containerd/containerd/sys"
Package sys provides access to the Get Child and Set Child prctl flags. See http://man7.org/linux/man-pages/man2/prctl.2.html
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 GetLocalListener(path string, uid, gid int) (net.Listener, error)
- func GetOpenFds(pid int) (int, error)
- func GetSubreaper() (int, error)
- func GetSystemCPUUsage() (uint64, error)
- func SetOOMScore(pid, score int) error
- func SetSubreaper(i int) error
- 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
Functions ¶
func CreateUnixSocket ¶
CreateUnixSocket creates a unix socket and returns the listener
func EpollCreate1 ¶
EpollCreate1 directly calls unix.EpollCreate1
func EpollCtl ¶
EpollCtl directly calls unix.EpollCtl
func EpollWait ¶
EpollWait directly calls unix.EpollWait
func GetLocalListener ¶
GetLocalListener returns a listerner out of a unix socket.
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 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 StatAtime ¶
func StatCtime ¶
func StatMtime ¶
Types ¶
type Exit ¶
Exit is the wait4 information from an exited process
func Reap ¶
Reap reaps all child processes for the calling process and returns their exit information
Source Files ¶
epoll.go fds.go oom_unix.go prctl.go proc.go reaper.go socket_unix.go stat_unix.go
- Version
- v1.0.0-alpha4
- Published
- Aug 10, 2017
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 5 seconds ago –
Tools for package owners.