package sys

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

Index

Constants

const (
	// OOMScoreAdjMin is from OOM_SCORE_ADJ_MIN https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L9
	OOMScoreAdjMin = -1000
	// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L10
	OOMScoreAdjMax = 1000
)

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.

func CreateUnixSocket

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

CreateUnixSocket creates a unix socket and returns the listener

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. It returns 0 (zero) if either no oom score is set, or a sore is set to 0.

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 provided pid

Source Files

filesys_unix.go oom_linux.go socket_unix.go

Directories

PathSynopsis
sys/reaper
Version
v1.7.3
Published
Jul 27, 2023
Platform
linux/amd64
Imports
8 packages
Last checked
1 second ago

Tools for package owners.