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 GetOpenFds

func GetOpenFds(pid int) (int, error)

GetOpenFds returns the number of open fds for the process provided by pid

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

Source Files

fds.go filesys_unix.go oom_unsupported.go socket_unix.go userns_deprecated.go

Directories

PathSynopsis
sys/reaper
Version
v1.6.0-beta.1
Published
Oct 22, 2021
Platform
js/wasm
Imports
7 packages
Last checked
1 minute ago

Tools for package owners.