Documentation
¶
Overview ¶
Package mountinfo parses /proc/self/mountinfo to discover filesystem mounts visible in the calling process's mount namespace.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindByFSType ¶
FindByFSType returns the mount points for filesystems of the given type, in order of appearance, with duplicates removed.
Types ¶
type Entry ¶
type Entry struct {
// MountPoint is the absolute path where the filesystem is mounted,
// with octal escapes (\040, \011, \012, \134) decoded.
MountPoint string
// Root is the path within the source filesystem that's exposed at
// MountPoint, octal-decoded. It is "/" for a full filesystem mount and
// some other path (e.g. "/events") when a subdirectory of the source
// filesystem has been bind-mounted onto MountPoint. Callers that want
// to use MountPoint as the root of a filesystem should reject entries
// where Root != "/".
Root string
// FSType is the filesystem type, e.g. "bpf", "tracefs", "debugfs".
FSType string
}
Entry represents one parsed line from /proc/self/mountinfo.
func Read ¶
Read parses /proc/self/mountinfo and returns one Entry per mount line. The result is cached for the lifetime of the process; mounts that appear or disappear after the first call are not reflected.
On non-Linux, returns an error wrapping internal.ErrNotSupportedOnOS.
Click to show internal directories.
Click to hide internal directories.