Documentation
¶
Overview ¶
Package proctree inspects process trees across supported platforms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is a point-in-time view of the process table captured once per scan. Reuse it for every PID in that scan: on platforms without /proc this reads the table in one or two ps calls instead of reforking ps per PID, and every lookup is memoised so repeated queries (e.g. Descendants computed per pane, Environ checked per candidate) never refork.
func (*Tree) CWD ¶
CWD returns the working directory of the given process with symlinks resolved. Resolved lazily and memoised: only the rare legacy/orphan paths need it, so each PID is looked up at most once (and on platforms without /proc that lookup forks lsof, which the common ID-matched path avoids).
func (*Tree) Descendants ¶
Descendants returns root and all its transitive child PIDs.