sys

package
v0.16.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

View Source
const (
	AT_SYSINFO_EHDR uintptr = 33
)

Variables

View Source
var CurrentMonotonicRaw = func() int64 {
	var ts unix.Timespec
	unix.ClockGettime(unix.CLOCK_MONOTONIC_RAW, &ts)
	return ts.Nano()
}

CurrentMonotonicRaw is a convenience function that returns that current system raw monotonic clock as an integer.

Functions

func ContainerID

func ContainerID(s string) string

ContainerID returns the ContainerID extracted from the given string. The string may simply be a container ID or it may be a full cgroup controller path with a container ID embedded in it. If the given string contains no discernable container ID, the return will be "".

func KernelVersion

func KernelVersion() (int, int, int)

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

func KernelVersionCode

func KernelVersionCode() uint32

KernelVersionCode returns a single integer that encodes the version of the running kernel. This code should be treated as having arbitrary meaning.

func LookupKernelSymbol

func LookupKernelSymbol(name string) (addr uintptr, ok bool)

LookupKernelSymbol returns the address of a symbol from the kernel's vDSO symbol table. The address has been relocated to the load offset in the current process and may be called are accessed directly by the returned address.

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 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

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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