k3s/vendor/github.com/opencontainers/runc/libcontainer/mount/mount.go
Darren Shepherd fa08d6076c Update vendor
2019-01-11 21:58:27 -07:00

24 lines
530 B
Go

package mount
// GetMounts retrieves a list of mounts for the current running process.
func GetMounts() ([]*Info, error) {
return parseMountTable()
}
// Mounted looks at /proc/self/mountinfo to determine of the specified
// mountpoint has been mounted
func Mounted(mountpoint string) (bool, error) {
entries, err := parseMountTable()
if err != nil {
return false, err
}
// Search the table for the mountpoint
for _, e := range entries {
if e.Mountpoint == mountpoint {
return true, nil
}
}
return false, nil
}