wsyscall

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 68

Documentation

Index

Constants

View Source
const (
	FALLOC_FL_COLLAPSE_RANGE = 0x8
	FALLOC_FL_INSERT_RANGE   = 0x20
	FALLOC_FL_KEEP_SIZE      = 0x1
	FALLOC_FL_NO_HIDE_STALE  = 0x4
	FALLOC_FL_PUNCH_HOLE     = 0x2
	FALLOC_FL_UNSHARE_RANGE  = 0x40
	FALLOC_FL_ZERO_RANGE     = 0x10

	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 Dup added in v0.3.2

func Dup(oldfd int) (int, error)

func Dup2 added in v0.3.2

func Dup2(oldfd int, newfd int) error

func Dup3 added in v0.3.2

func Dup3(oldfd int, newfd int, flags int) error

func Fallocate

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

func GetFileDescriptorLimit added in v0.3.2

func GetFileDescriptorLimit() (uint64, uint64, error)

GetFileDescriptorLimit returns the current limit and maximum limit on number of open file descriptors.

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 Reboot added in v0.3.2

func Reboot() error

func SetAllGid

func SetAllGid(gid int) error

func SetAllUid

func SetAllUid(uid int) error

func SetMyPriority added in v0.3.2

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 Sync added in v0.3.2

func Sync() 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