package sys

import "github.com/containerd/containerd/sys"

Index

Constants

const (
	// OOMScoreMaxKillable is not implemented on non Linux
	OOMScoreMaxKillable = 0
	// OOMScoreAdjMax is not implemented on non Linux
	OOMScoreAdjMax = 0
)

Variables

var RunningInUserNS = userns.RunningInUserNS

RunningInUserNS detects whether we are currently running in a user namespace. Deprecated: use github.com/containerd/containerd/pkg/userns.RunningInUserNS instead.

Functions

func AdjustOOMScore

func AdjustOOMScore(pid, score int) error

AdjustOOMScore sets the oom score for the provided pid. If the provided score is out of range (-1000 - 1000), it is clipped to the min/max value.

Not implemented on Windows

func CreateUnixSocket

func CreateUnixSocket(path string) (net.Listener, error)

CreateUnixSocket creates a unix socket and returns the listener

func ForceRemoveAll

func ForceRemoveAll(path string) error

ForceRemoveAll on unix is just a wrapper for os.RemoveAll

func GetLocalListener

func GetLocalListener(path string, uid, gid int) (net.Listener, error)

GetLocalListener returns a listener out of a unix socket.

func GetOOMScoreAdj

func GetOOMScoreAdj(pid int) (int, error)

GetOOMScoreAdj gets the oom score for a process

Not implemented on Windows

func MkdirAllWithACL

func MkdirAllWithACL(path string, perm os.FileMode) error

MkdirAllWithACL is a wrapper for os.MkdirAll on Unix systems.

func SetOOMScore

func SetOOMScore(pid, score int) error

SetOOMScore sets the oom score for the process

Not implemented on Windows

func StatATimeAsTime

func StatATimeAsTime(st *syscall.Stat_t) time.Time

StatATimeAsTime returns the access time as a time.Time

func StatAtime

func StatAtime(st *syscall.Stat_t) syscall.Timespec

StatAtime returns the access time from a stat struct

func StatCtime

func StatCtime(st *syscall.Stat_t) syscall.Timespec

StatCtime returns the created time from a stat struct

func StatMtime

func StatMtime(st *syscall.Stat_t) syscall.Timespec

StatMtime returns the modified time from a stat struct

Source Files

filesys_unix.go oom_unsupported.go socket_unix.go stat_bsd.go userns_deprecated.go

Directories

PathSynopsis
sys/reaper
Version
v1.5.10
Published
Mar 2, 2022
Platform
darwin/amd64
Imports
8 packages
Last checked
4 minutes ago

Tools for package owners.