wsyscall

package
v0.0.0-...-63c3a42 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MS_BIND = 1 << iota
	MS_RDONLY

	RUSAGE_CHILDREN = iota
	RUSAGE_SELF
	RUSAGE_THREAD
)
View Source
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 Fallocate

func Fallocate(fd int, mode uint32, off int64, len int64) error

func Getrusage

func Getrusage(who int, rusage *Rusage) error

func Ioctl

func Ioctl(fd int, request, argp uintptr) error

func Lstat

func Lstat(path string, statbuf *Stat_t) error

func Mount

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

func SetAllGid

func SetAllGid(gid int) error

func SetAllUid

func SetAllUid(uid int) error

func SetMyPriority

func SetMyPriority(priority int) error

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

func SetNetNamespace(fd int) error

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 Stat

func Stat(path string, statbuf *Stat_t) error

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

func UnshareNetNamespace() (fd int, tid int, err error)

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.

Types

type Rusage

type Rusage struct {
	Utime    Timeval
	Stime    Timeval
	Maxrss   int64
	Ixrss    int64
	Idrss    int64
	Isrss    int64
	Minflt   int64
	Majflt   int64
	Nswap    int64
	Inblock  int64
	Oublock  int64
	Msgsnd   int64
	Msgrcv   int64
	Nsignals int64
	Nvcsw    int64
	Nivcsw   int64
}

type Stat_t

type Stat_t struct {
	Dev     uint64
	Ino     uint64
	Nlink   uint64
	Mode    uint32
	Uid     uint32
	Gid     uint32
	Rdev    uint64
	Size    int64
	Blksize int64
	Blocks  int64
	Atim    syscall.Timespec
	Mtim    syscall.Timespec
	Ctim    syscall.Timespec
}

type Timeval

type Timeval struct {
	Sec  int64
	Usec int64
}

Jump to

Keyboard shortcuts

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