Documentation ¶
Index ¶
- func CountChilds(pid int) (int, error)
- func ExtractPid(path string) (pid uint, err error)
- func GetMountPointMap(path string) (map[string][]string, error)
- func Getppid(pid int) (int, error)
- func HasFilesystem(fs string) (bool, error)
- func HasNamespace(pid int, nstype string) (bool, error)
- func ParentMount(path string) (string, error)
- func ReadIDMap(path string) (uint32, uint32, error)
- func SetOOMScoreAdj(pid int, score *int) error
- type MountInfoEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountChilds ¶
CountChilds returns the number of child processes for a given process id
func ExtractPid ¶
ExtractPid returns a pid extracted from path of type "/proc/1"
func GetMountPointMap ¶
GetMountPointMap parses mountinfo pointing to path and returns a map of parent mount points with associated child mount points.
func Getppid ¶
Getppid returns the parent process ID for the corresponding process ID passed in parameter.
func HasFilesystem ¶
HasFilesystem returns whether kernel support filesystem or not
func HasNamespace ¶
HasNamespace checks if host namespace and container namespace are different.
func ParentMount ¶
ParentMount parses mountinfo and returns the path of parent mount point for which the provided path is mounted in.
func SetOOMScoreAdj ¶
SetOOMScoreAdj sets OOM score for process with pid
Types ¶
type MountInfoEntry ¶
type MountInfoEntry struct { ID string ParentID string Dev string Root string Point string Options []string Fields string FSType string Source string SuperOptions []string }
MountInfoEntry contains parsed fields of a mountinfo line.
func FindParentMountEntry ¶
func FindParentMountEntry(path string, entries []MountInfoEntry) (*MountInfoEntry, error)
FindParentMountEntry finds the parent mount point entry associated to the provided path among the entry list provided in argument.
func GetMountInfoEntry ¶
func GetMountInfoEntry(path string) ([]MountInfoEntry, error)
GetMountInfoEntry parses a mountinfo file and returns all parsed entries as an array of MountInfoEntry.