sys

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
	OOMScoreMaxKillable = -999
	// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/master/include/uapi/linux/oom.h
	OOMScoreAdjMax = 1000
)

Variables

This section is empty.

Functions

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

func GetOpenFds

func GetOpenFds(pid int) (int, error)

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

func IsFifo

func IsFifo(path string) (bool, error)

IsFifo checks if a file is a (named pipe) fifo if the file does not exist then it returns false

func MkdirAllWithACL

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

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

func RunningInUserNS

func RunningInUserNS() bool

RunningInUserNS is a stub for non-Linux systems Always returns false

func RunningPrivileged

func RunningPrivileged() bool

RunningPrivileged returns true if the effective user ID of the calling process is 0

func RunningUnprivileged

func RunningUnprivileged() bool

RunningUnprivileged returns true if the effective user ID of the calling process is not 0

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