procinfo

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProcessInspector

type ProcessInspector struct{}

ProcessInspector wraps gopsutil process inspection for non-Darwin platforms.

func NewProcessInspector

func NewProcessInspector() *ProcessInspector

NewProcessInspector creates a new ProcessInspector.

func (*ProcessInspector) CreateTime

func (p *ProcessInspector) CreateTime(pid int32) (int64, error)

CreateTime returns the creation time of the process in epoch milliseconds.

func (*ProcessInspector) Cwd

func (p *ProcessInspector) Cwd(pid int32) (string, error)

Cwd returns the current working directory for the given PID.

func (*ProcessInspector) IsAlive

func (p *ProcessInspector) IsAlive(pid int32, expectedCreateTimeMs int64) bool

IsAlive returns true if the process with the given PID is alive AND its creation time matches expectedCreateTimeMs. This guards against PID reuse.

func (*ProcessInspector) OpenFiles

func (p *ProcessInspector) OpenFiles(pid int32) ([]string, error)

OpenFiles returns the list of open file paths for the given PID. Uses /proc on Linux via gopsutil. Returns an empty slice (no error) when access is denied or the process has exited.

Jump to

Keyboard shortcuts

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