system

package
v0.0.0-...-e411b72 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProcessStartTime

func GetProcessStartTime(pid int) (string, error)

GetProcessStartTime is deprecated. Use Stat(pid) and Stat_t.StartTime instead.

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