On this page
Package procutil provides cross-platform process liveness checks.
#internal/procutil
#internal/procutil
Package procutil provides cross-platform process liveness checks.
#ErrNoStartTime
var ErrNoStartTime = errors.New("process start time unavailable")ErrNoStartTime is returned by StartTime when the process start time cannot be determined: the platform does not expose it, the PID is gone, or the kernel-provided data is unparseable. Callers must fail closed on this error (assume the recorded identity still holds) rather than guessing.
#Start
type Start structStart identifies one specific run of a process on the local machine.
A PID alone is not an identity: PIDs are reused. Ticks pins the PID to the exact process instance that occupied it, so a recorded (pid, ticks) pair can be re-read later and compared to decide whether the original process is still the one holding that PID.
#ProcessAlive
func ProcessAlive(pid int) boolProcessAlive checks if a process with the given PID exists. Returns true if the process is alive (including cases where we lack permission to signal it).
#StartTime
func StartTime(pid int) (Start, error)StartTime reads the start time of the process with the given PID from /proc/
#StartTime
func StartTime(pid int) (Start, error)StartTime is unavailable off Linux: there is no /proc/