system

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 10 Imported by: 2,475

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearKeepCaps

func ClearKeepCaps() error

func ClearRlimitNofileCache added in v1.1.13

func ClearRlimitNofileCache(lim *syscall.Rlimit)

ClearRlimitNofileCache clears go runtime's nofile rlimit cache. The argument is process RLIMIT_NOFILE values. Relies on go.dev/cl/588076.

func Exec added in v1.0.1

func Exec(cmd string, args []string, env []string) error

func Execv deprecated

func Execv(cmd string, args []string, env []string) error

Deprecated: Execv is not used in runc anymore, it will be removed in v1.2.0.

func GetSubreaper added in v1.0.0

func GetSubreaper() (int, error)

GetSubreaper returns the subreaper setting for the calling process

func Mkdirat added in v1.1.14

func Mkdirat(dir *os.File, path string, mode uint32) error

func Openat added in v1.1.14

func Openat(dir *os.File, path string, flags int, mode uint32) (*os.File, error)

func SetKeepCaps

func SetKeepCaps() error

func SetParentDeathSignal

func SetParentDeathSignal(sig uintptr) error

func SetSubreaper added in v0.1.0

func SetSubreaper(i int) error

SetSubreaper sets the value i as the subreaper setting for the calling process

func Setctty

func Setctty() error

func Setgid

func Setgid(gid int) (err error)

Setgid sets the gid of the calling thread to the specified gid.

func Setuid

func Setuid(uid int) (err error)

Setuid sets the uid of the calling thread to the specified uid.

Types

type ParentDeathSignal

type ParentDeathSignal int

func GetParentDeathSignal

func GetParentDeathSignal() (ParentDeathSignal, error)

func (ParentDeathSignal) Restore

func (p ParentDeathSignal) Restore() error

func (ParentDeathSignal) Set

func (p ParentDeathSignal) Set() error

type Stat_t added in v1.0.0

type Stat_t struct {
	// Name is the command run by the process.
	Name string

	// State is the state of the process.
	State State

	// StartTime is the number of clock ticks after system boot (since
	// Linux 2.6).
	StartTime uint64
}

Stat_t represents the information from /proc/[pid]/stat, as described in proc(5) with names based on the /proc/[pid]/status fields.

func Stat added in v1.0.0

func Stat(pid int) (stat Stat_t, err error)

Stat returns a Stat_t instance for the specified process.

type State added in v1.0.0

type State rune

State is the status of a process.

const (
	Dead        State = 'X'
	DiskSleep   State = 'D'
	Running     State = 'R'
	Sleeping    State = 'S'
	Stopped     State = 'T'
	TracingStop State = 't'
	Zombie      State = 'Z'
	Parked      State = 'P'
	Idle        State = 'I'
)

func (State) String added in v1.0.0

func (s State) String() string

String forms of the state from proc(5)'s documentation for /proc/[pid]/status' "State" field.

Jump to

Keyboard shortcuts

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