processinfo

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandName

func CommandName(ctx context.Context, pid int) (string, error)

CommandName returns the executable command name for pid on Linux.

func StartIdentity

func StartIdentity(ctx context.Context, pid int) string

StartIdentity returns a boot-qualified process start identity for pid.

Types

type PermissionError

type PermissionError struct {
	Path string
	Err  error
}

PermissionError reports an inability to inspect a process table or entry.

func (*PermissionError) Error

func (e *PermissionError) Error() string

func (*PermissionError) Unwrap

func (e *PermissionError) Unwrap() error

type Process

type Process struct {
	PID                int
	PPID               int
	ProcessGroupID     int
	Foreground         bool
	StartIdentity      string
	Executable         string
	CWD                string
	TTY                string
	AgentHint          string
	MultiplexerKind    string
	MultiplexerServer  string
	MultiplexerSession string
	MultiplexerPane    string
	Args               []string `json:"-"`
}

Process is a point-in-time snapshot of a process. Args, AgentHint, and the multiplexer hints are transient inventory data and must not be persisted by callers.

func Find

func Find(ctx context.Context, pid int) (Process, bool, error)

Find returns the current-user process identified by pid. A false found result means the process does not exist or belongs to another user.

func List

func List(ctx context.Context) ([]Process, error)

List returns a complete best-effort snapshot of processes owned by the effective user. Processes which exit while being read are skipped.

type TableError

type TableError struct {
	Path string
	Err  error
}

TableError reports malformed or otherwise unusable process table data.

func (*TableError) Error

func (e *TableError) Error() string

func (*TableError) Unwrap

func (e *TableError) Unwrap() error

type UnsupportedError

type UnsupportedError struct {
	Platform string
}

UnsupportedError reports that process enumeration is unavailable on the current operating system.

func (*UnsupportedError) Error

func (e *UnsupportedError) Error() string

Jump to

Keyboard shortcuts

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