Documentation
¶
Index ¶
- func Tree(pid int) []int
- type L
- type T
- func (t T) CommandLine() string
- func (t *T) Env() map[string]string
- func (t T) Head() string
- func (t T) PID() int
- func (t T) PPID() (int, error)
- func (t T) Process() (*os.Process, error)
- func (t T) RunsSince(startTime uint64) bool
- func (t T) Signal(sig os.Signal) error
- func (t T) SignalIf(sig os.Signal, same func(T) bool) (bool, error)
- func (t T) StartTime() (uint64, error)
- func (t T) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type T ¶
type T struct {
// contains filtered or unexported fields
}
func (T) CommandLine ¶
func (T) RunsSince ¶
RunsSince says the process still runs, started at startTime: a process named by its pid and its start time, which stay readable while it execve's, unlike its environ.
A process showing as a zombie with other threads still counted runs: its thread group leader exited, as it does when another thread execve's, or as a program whose main thread returned and whose other threads go on. A stat read failing is retried for a short time, as it fails while the kernel makes an exec'ing thread the thread group leader.
func (T) SignalIf ¶
SignalIf sends sig to the process when same, asked once the process is held, says it still is the one the caller found, and reports whether it sent it. On Linux the process is held by a pidfd, which the signal goes through: a pid the process left, and another process took, between the check and the signal is not signaled.