sys

package
v1.4.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const OOMScoreMaxKillable = -999

OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer

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

Functions

func CreateUnixSocket

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

CreateUnixSocket creates a unix socket and returns the listener

func FMountat added in v1.1.4

func FMountat(dirfd uintptr, source, target, fstype string, flags uintptr, data string) error

FMountat performs mount from the provided directory.

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

func GetOpenFds

func GetOpenFds(pid int) (int, error)

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

func IsFifo added in v1.3.4

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

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

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

func RunningInUserNS added in v1.4.0

func RunningInUserNS() bool

RunningInUserNS detects whether we are currently running in a user namespace. Originally copied from github.com/lxc/lxd/shared/util.go

func RunningPrivileged added in v1.1.4

func RunningPrivileged() bool

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

func RunningUnprivileged added in v1.1.4

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

func StatATimeAsTime added in v1.1.0

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

StatATimeAsTime returns st.Atim as a time.Time

func StatAtime

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

StatAtime returns the Atim

func StatCtime

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

StatCtime returns the Ctim

func StatMtime

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

StatMtime returns the Mtim

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