Documentation ¶
Index ¶
- Constants
- func Fallocate(fd int, mode uint32, off int64, len int64) error
- func Getrusage(who int, rusage *Rusage) error
- func Ioctl(fd int, request, argp uintptr) error
- func Lstat(path string, statbuf *Stat_t) error
- func Mount(source string, target string, fstype string, flags uintptr, data string) error
- func SetAllGid(gid int) error
- func SetAllUid(uid int) error
- func SetMyPriority(priority int) error
- func SetNetNamespace(fd int) error
- func Stat(path string, statbuf *Stat_t) error
- func UnshareMountNamespace() error
- func UnshareNetNamespace() (fd int, tid int, err error)
- type Rusage
- type Stat_t
- type Timeval
Constants ¶
const ( MS_BIND = 1 << iota MS_RDONLY RUSAGE_CHILDREN = iota RUSAGE_SELF RUSAGE_THREAD )
const ( S_IFBLK = syscall.S_IFBLK S_IFCHR = syscall.S_IFCHR S_IFDIR = syscall.S_IFDIR S_IFIFO = syscall.S_IFIFO S_IFLNK = syscall.S_IFLNK S_IFMT = syscall.S_IFMT S_IFREG = syscall.S_IFREG S_IFSOCK = syscall.S_IFSOCK S_IREAD = syscall.S_IREAD S_IRGRP = syscall.S_IRGRP S_IROTH = syscall.S_IROTH S_IRUSR = syscall.S_IRUSR S_IRWXG = syscall.S_IRWXG S_IRWXO = syscall.S_IRWXO S_IRWXU = syscall.S_IRWXU S_ISGID = syscall.S_ISGID S_ISUID = syscall.S_ISUID S_ISVTX = syscall.S_ISVTX S_IWGRP = syscall.S_IWGRP S_IWOTH = syscall.S_IWOTH S_IWRITE = syscall.S_IWRITE S_IWUSR = syscall.S_IWUSR S_IXGRP = syscall.S_IXGRP S_IXOTH = syscall.S_IXOTH S_IXUSR = syscall.S_IXUSR )
Variables ¶
This section is empty.
Functions ¶
func SetMyPriority ¶
SetMyPriority sets the priority of the current process, for all OS threads. On platforms which do not support changing the process priority, an error is always returned.
func SetNetNamespace ¶
SetNetNamespace is a safe wrapper for the Linux setns(fd, CLONE_NEWNET) system call. On Linux it will lock the current goroutine to an OS thread and set the network namespace to the specified file descriptor. On failure or on other platforms an error is returned.
func UnshareMountNamespace ¶
func UnshareMountNamespace() error
UnshareMountNamespace is a safe wrapper for the Linux unshare(CLONE_NEWNS) system call. On Linux it will lock the current goroutine to an OS thread and unshare the mount namespace (the thread will have a private copy of the previous mount namespace). On failure or on other platforms an error is returned.
func UnshareNetNamespace ¶
UnshareNetNamespace is a safe wrapper for the Linux unshare(CLONE_NEWNET) system call. On Linux it will lock the current goroutine to an OS thread and unshare the network namespace (the thread will have a fresh network namespace). The file descriptor for the new network namespace and the Linux thread ID are returned. On failure or on other platforms an error is returned.