Version: v1.10.4 Latest Latest

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 9 Imported by: 6




View Source
const (
	// FilesystemType superblock magic numbers for filesystems,
	// to be used for IsMountFS.
	FilesystemTypeBPFFS   = unix.BPF_FS_MAGIC
	FilesystemTypeCgroup2 = unix.CGROUP2_SUPER_MAGIC


This section is empty.


func IsMountFS

func IsMountFS(mntType int64, path string) (bool, bool, error)

IsMountFS returns two boolean values, checking

- whether the path is a mount point;
- if yes, whether its filesystem type is mntType.

Note that this function can not detect bind mounts, and is not working properly when path="/".


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:

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
t or T : Toggle theme light dark auto
y or Y : Canonical URL