Documentation
¶
Overview ¶
Process group control and process table queries shared by the shell and the MCP child processes
Index ¶
- Constants
- Variables
- func Birth(pid int) (float64, error)
- func BootStart(pid int) (float64, bool)
- func BootTime() (float64, error)
- func ClockTicks() float64
- func Cmdline(pid int) ([]string, error)
- func Cwd(pid int) (string, error)
- func Environ(pid int) (map[string]string, error)
- func Exe(pid int) (string, error)
- func Exists(pid int) bool
- func Group(cmd *exec.Cmd)
- func Kill(cmd *exec.Cmd) error
- func KillPID(pid int) error
- func KillTree(pid int)
- func Name(pid int) (string, error)
- func PIDs() ([]int, error)
- func PPID(pid int) (int, bool)
- func Parents(pid int) ([]int, error)
- func PidExists(pid int) (bool, error)
- func RSS(pid int) (int64, error)
- func RealUID(pid int) (int, error)
- func SignalProbeLive(pid int) bool
- func State(pid int) (byte, error)
- func Terminate(pid int) error
- func Username(pid int) (string, error)
- func WorkerBirth(pid int) (float64, error)
- func Zombie(pid int) bool
- type OpenFile
- type Process
- type Table
Constants ¶
const CwdAvailable = true
Linux reads every process cwd from procfs
Variables ¶
var ErrAccessDenied = errors.New("access denied")
Raised when the OS refuses to show another process's descriptors, psutil AccessDenied
var ErrNoSuchProcess = errors.New("no such process")
Error of a probe whose pid does not exist
Functions ¶
func ClockTicks ¶
func ClockTicks() float64
Kernel clock ticks per second, the SC_CLK_TCK psutil divides CPU and start times by
func Cwd ¶
Working directory of pid like psutil, a deleted suffix dropped unless that literal path exists
func Exists ¶
Reports a live process for pid without signalling it, zombies counting as dead and a pid outside the 32-bit pid_t range naming no process
func KillTree ¶
func KillTree(pid int)
Kills pid and every descendant, sweeping twice so children forked during the first pass die too
func Name ¶
Process name like psutil, a 15 byte kernel name widened to the argv0 basename it truncates
func Parents ¶
Ancestors of pid nearest first like psutil, ending at the lowest pid, a vanished parent or a reused pid
func PidExists ¶
Whether pid names a process as psutil pid_exists answers, zombies counted and the error psutil raises returned
func SignalProbeLive ¶
Whether a signal zero to pid succeeds or is denied, any other failure reading as dead
func WorkerBirth ¶
Boot relative start of pid, the stamp worker records compare against
Types ¶
type Table ¶
type Table []Process
Processes running at one instant
func (Table) Descendants ¶
Every live descendant of pid, parents before their children, zombies left for their parent to reap