mountinfo

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// FilesystemType names for filesystem which are used in /proc/pid/mountinfo
	FilesystemTypeBPFFS   = "bpf"
	FilesystemTypeCgroup2 = "cgroup2"
	FilesystemTypeDebugFS = "debugfs"
	FilesystemTypeTraceFS = "tracefs"
)

Variables

This section is empty.

Functions

func IsMountFS

func IsMountFS(infos []*MountInfo, mntType string, mapRoot string) (bool, bool)

IsMountFS returns two boolean values:checks whether the current mapRoot: - whether the current mapRoot has any mount - whether that mount's filesystem is of type mntType

Types

type MountInfo

type MountInfo struct {
	MountID        int64
	ParentID       int64
	StDev          string
	Root           string
	MountPoint     string
	MountOptions   string
	OptionalFields []string
	FilesystemType string
	MountSource    string
	SuperOptions   string
}

MountInfo is a struct representing information from /proc/pid/mountinfo. More information about file syntax: https://www.kernel.org/doc/Documentation/filesystems/proc.txt

func GetMountInfo

func GetMountInfo() ([]*MountInfo, error)

GetMountInfo returns a slice of *MountInfo with information parsed from /proc/self/mountinfo

Jump to

Keyboard shortcuts

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