procfs

package
v0.0.0-...-205da4a Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitHostProcfs

func InitHostProcfs() error

func MountPoint

func MountPoint() string

Types

type Process

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

func AllProcesses

func AllProcesses() ([]*Process, error)

func NewProcess

func NewProcess(pid int) (*Process, error)

func (*Process) CGroupNsId

func (proc *Process) CGroupNsId() (uint32, error)

CGroupNsId reads cgroup namespace inode for specified process id and host procfs

func (*Process) Children

func (proc *Process) Children(all bool) ([]*Process, error)

func (*Process) Cmdline

func (proc *Process) Cmdline() ([]string, error)

func (*Process) Comm

func (proc *Process) Comm() (string, error)

func (*Process) Cwd

func (proc *Process) Cwd() (string, error)

func (*Process) Environ

func (proc *Process) Environ() ([]string, error)

func (*Process) Executable

func (proc *Process) Executable() (string, error)

func (*Process) MountNsId

func (proc *Process) MountNsId() (uint32, error)

MountNsId reads mount namespace inode for specified process id and host procfs

func (*Process) NetNsId

func (proc *Process) NetNsId() (uint32, error)

NetNsId reads net namespace inode for specified process id and host procfs

func (*Process) PPid

func (proc *Process) PPid() (int, error)

func (*Process) Pid

func (proc *Process) Pid() int

func (*Process) PidNsId

func (proc *Process) PidNsId() (uint32, error)

PidNsId reads pid namespace inode for specified process id and host procfs

func (*Process) Root

func (proc *Process) Root() (string, error)

func (*Process) Stat

func (proc *Process) Stat() (stat *Stat, err error)

Stat reads /proc/${pid}/stat into Stat object

func (*Process) Status

func (proc *Process) Status() (status *Status, err error)

func (*Process) UserNsId

func (proc *Process) UserNsId() (uint32, error)

UserNsId reads user namespace inode for specified process id and host procfs

func (*Process) UtsNsId

func (proc *Process) UtsNsId() (uint32, error)

UtsNsId reads uts namespace inode for specified process id and host procfs

type Procfs

type Procfs interface {
	MountPoint() string
	NewProcess(pid int) (*Process, error)
	AllProcesses() ([]*Process, error)
}

func New

func New(mountPoint string) (Procfs, error)

type Stat

type Stat struct {
	Pid         int
	Comm        string
	State       byte
	PPid        int
	PGrp        int
	Session     int
	TTY         int
	TPGid       int
	Flags       uint
	Minflt      uint64
	Cminflt     uint64
	Majflt      uint64
	Cmajflt     uint64
	Utime       uint64
	Stime       uint64
	Cutime      uint64
	Cstime      uint64
	Priority    int64
	Nice        int64
	NumThreads  int64
	Itrealvalue int64
	Starttime   uint64
	Vsize       uint64
	Rss         uint64
	Rsslim      uint64
}

type Status

type Status struct {
	Name  string
	Umask int
	State byte
	Pid   int
	PPid  int
	Uid   int
	Gid   int
	NsPid int
}

Jump to

Keyboard shortcuts

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