Documentation ¶
Index ¶
- func CurrentMonotonicRaw() int64
- func HostProcFS() *proc.FileSystem
- func KernelVersion() (int, int, int)
- func MountTempFS(source string, target string, fstype string, flags uintptr, data string) error
- func PerfEventDir() string
- func ProcFS() *proc.FileSystem
- func TracingDir() string
- func UnmountTempFS(dir string, fstype string) error
- type Mount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentMonotonicRaw ¶
func CurrentMonotonicRaw() int64
CurrentMonotonicRaw is a convenience function that returns that current system raw monotonic clock as an integer.
func HostProcFS ¶
func HostProcFS() *proc.FileSystem
HostProcFS creates a proc.FileSystem representing the underlying host's procfs. If we are running in the host pid namespace, it uses /proc. Otherwise, it identifies a mounted-in host procfs by it being mounted on a directory that isn't /proc and /proc/self linking to a differing PID than that returned by os.Getpid(). If we are running in a container and no mounted-in host procfs was identified, then it returns nil.
func KernelVersion ¶
KernelVersion returns the version of the currently running kernel in major, minor, patchlevel form.
func MountTempFS ¶
MountTempFS mounts a filesystem. It is primarily a wrapper around unix.Mount, but it also ensures that the mountpoint exists before attempting to mount to it.
func PerfEventDir ¶
func PerfEventDir() string
PerfEventDir returns the mountpoint of the perf_event cgroup pseudo-filesystem or an empty string if it wasn't found.
func ProcFS ¶
func ProcFS() *proc.FileSystem
ProcFS creates a proc.FileSystem representing the default procfs mountpoint /proc. When running inside a container, this will contain information from the container's pid namespace.
func TracingDir ¶
func TracingDir() string
TracingDir returns the directory on either the debugfs or tracefs used to control the Linux kernel trace event subsystem.
func UnmountTempFS ¶
UnmountTempFS unmounts a filesystem. It is primarily a wrapper around unix.Unmount, but it also removes the mountpoint after the filesystem is unmounted.
Types ¶
type Mount ¶
type Mount struct { MountID uint ParentID uint Major uint Minor uint Root string MountPoint string MountOptions []string OptionalFields map[string]string FilesystemType string MountSource string SuperOptions map[string]string }
Mount holds information about a mount in the process's mount namespace.