system

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParentNSeuid

func GetParentNSeuid() int

GetParentNSeuid returns the euid within the parent user namespace Always returns os.Geteuid on non-linux

func RunningInUserNS

func RunningInUserNS() bool

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

func UIDMapInUserNS

func UIDMapInUserNS(uidmap []user.IDMap) bool

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

Types

type Stat_t

type Stat_t struct {
	// PID is the process ID.
	PID uint

	// 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

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

Stat returns a Stat_t instance for the specified process.

type State

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'
)

func (State) String

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