sys

package
v1.6.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 8 Imported by: 1,245

Documentation

Index

Constants

View Source
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
)

Variables

View Source
var EpollCreate1 = unix.EpollCreate1

EpollCreate1 is an alias for unix.EpollCreate1 Deprecated: use golang.org/x/sys/unix.EpollCreate1

View Source
var EpollCtl = unix.EpollCtl

EpollCtl is an alias for unix.EpollCtl Deprecated: use golang.org/x/sys/unix.EpollCtl

View Source
var EpollWait = unix.EpollWait

EpollWait is an alias for unix.EpollWait Deprecated: use golang.org/x/sys/unix.EpollWait

View Source
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 added in v1.5.0

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 ForceRemoveAll added in v1.1.0

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 added in v1.3.0

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 GetOpenFds

func GetOpenFds(pid int) (int, error)

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

func MkdirAllWithACL added in v1.3.0

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

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL