proc

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Path = "/proc"

Path to proc filesystem.

Variables

View Source
var (
	ErrCannotGetPIDNSInode            = errors.New("cannot get pidns inode")
	ErrParseStatFileInvalidCommFormat = errors.New("cannot parse stat file, invalid comm format")
	ErrParseStatFileNotEnoughFields   = errors.New("cannot parse stat file, not enough fields")
)

Functions

This section is empty.

Types

type NamespaceID

type NamespaceID = uint64

type NamespaceType

type NamespaceType string
const (
	PIDNamespace   NamespaceType = "pid"
	MountNamespace NamespaceType = "mnt"
)

type PID

type PID = uint32

type Proc

type Proc struct {
	// contains filtered or unexported fields
}

func New

func New() *Proc

func (*Proc) GetCurrentPIDNSID

func (p *Proc) GetCurrentPIDNSID() (NamespaceID, error)

func (*Proc) GetNSForPID

func (p *Proc) GetNSForPID(pid PID, ns NamespaceType) (NamespaceID, error)

func (*Proc) GetProcessStartTime

func (p *Proc) GetProcessStartTime(pid PID) (uint64, error)

GetProcessStartTime parses the /proc/<pid>/stat file to determine the start time of the process after system boot.

func (*Proc) LoadMountNSOldestProcesses

func (p *Proc) LoadMountNSOldestProcesses() (map[NamespaceID]PID, error)

type ProcFS

type ProcFS interface {
	fs.ReadDirFS
	fs.ReadFileFS
	fs.StatFS
}

func GetFS

func GetFS() ProcFS

Jump to

Keyboard shortcuts

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