sys

package
v0.15.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 11 Imported by: 20

Documentation

Index

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

func KernelVersion() (int, int, int)

KernelVersion returns the version of the currently running kernel in major, minor, patchlevel form.

func MountTempFS

func MountTempFS(source string, target string, fstype string, flags uintptr, data string) error

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

func UnmountTempFS(dir string, fstype string) error

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.

func Mounts

func Mounts() []Mount

Mounts returns the list of currently mounted filesystems.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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