linux

package
v0.0.0-...-23e6066 Latest Latest
Warning

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

Go to latest
Published: May 3, 2018 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Overview

Package linux provides syscall tables for amd64 Linux.

NOTE: Linux i386 support has been removed.

Index

Constants

View Source
const (
	// EFD_SEMAPHORE is a flag used in syscall eventfd(2) and eventfd2(2). Please
	// see its man page for more information.
	EFD_SEMAPHORE = 1
	EFD_NONBLOCK  = 0x800
	EFD_CLOEXEC   = 0x80000
)
View Source
const (
	// ExecMaxTotalSize is the maximum length of all argv and envv entries.
	//
	// N.B. The behavior here is different than Linux. Linux provides a limit on
	// individual arguments of 32 pages, and an aggregate limit of at least 32 pages
	// but otherwise bounded by min(stack size / 4, 8 MB * 3 / 4). We don't implement
	// any behavior based on the stack size, and instead provide a fixed hard-limit of
	// 2 MB (which should work well given that 8 MB stack limits are common).
	ExecMaxTotalSize = 2 * 1024 * 1024

	// ExecMaxElemSize is the maximum length of a single argv or envv entry.
	ExecMaxElemSize = 32 * usermem.PageSize
)
View Source
const (
	// EventMaskRead contains events that can be triggerd on reads.
	EventMaskRead = waiter.EventIn | waiter.EventHUp | waiter.EventErr
)
View Source
const (
	// EventMaskWrite contains events that can be triggered on writes.
	//
	// Note that EventHUp is not going to happen for pipes but may for
	// implementations of poll on some sockets, see net/core/datagram.c.
	EventMaskWrite = waiter.EventOut | waiter.EventHUp | waiter.EventErr
)

Variables

View Source
var AMD64 = &kernel.SyscallTable{
	OS:   abi.Linux,
	Arch: arch.AMD64,
	Version: kernel.Version{
		Sysname: "Linux",
		Release: "3.11.10",
		Version: "#1 SMP Fri Nov 29 10:47:50 PST 2013",
	},
	AuditNumber: _AUDIT_ARCH_X86_64,
	Table: map[uintptr]kernel.SyscallFn{
		0:  Read,
		1:  Write,
		2:  Open,
		3:  Close,
		4:  Stat,
		5:  Fstat,
		6:  Lstat,
		7:  Poll,
		8:  Lseek,
		9:  Mmap,
		10: Mprotect,
		11: Munmap,
		12: Brk,
		13: RtSigaction,
		14: RtSigprocmask,
		15: RtSigreturn,
		16: Ioctl,
		17: Pread64,
		18: Pwrite64,
		19: Readv,
		20: Writev,
		21: Access,
		22: Pipe,
		23: Select,
		24: SchedYield,
		25: Mremap,
		26: Msync,
		27: Mincore,
		28: Madvise,

		32: Dup,
		33: Dup2,
		34: Pause,
		35: Nanosleep,
		36: Getitimer,
		37: Alarm,
		38: Setitimer,
		39: Getpid,
		40: Sendfile,
		41: Socket,
		42: Connect,
		43: Accept,
		44: SendTo,
		45: RecvFrom,
		46: SendMsg,
		47: RecvMsg,
		48: Shutdown,
		49: Bind,
		50: Listen,
		51: GetSockName,
		52: GetPeerName,
		53: SocketPair,
		54: SetSockOpt,
		55: GetSockOpt,
		56: Clone,
		57: Fork,
		58: Vfork,
		59: Execve,
		60: Exit,
		61: Wait4,
		62: Kill,
		63: Uname,
		64: Semget,
		65: Semop,
		66: Semctl,

		72:  Fcntl,
		73:  Flock,
		74:  Fsync,
		75:  Fdatasync,
		76:  Truncate,
		77:  Ftruncate,
		78:  Getdents,
		79:  Getcwd,
		80:  Chdir,
		81:  Fchdir,
		82:  Rename,
		83:  Mkdir,
		84:  Rmdir,
		85:  Creat,
		86:  Link,
		87:  Unlink,
		88:  Symlink,
		89:  Readlink,
		90:  Chmod,
		91:  Fchmod,
		92:  Chown,
		93:  Fchown,
		94:  Lchown,
		95:  Umask,
		96:  Gettimeofday,
		97:  Getrlimit,
		98:  Getrusage,
		99:  Sysinfo,
		100: Times,
		101: Ptrace,
		102: Getuid,
		103: Syslog,
		104: Getgid,
		105: Setuid,
		106: Setgid,
		107: Geteuid,
		108: Getegid,
		109: Setpgid,
		110: Getppid,
		111: Getpgrp,
		112: Setsid,
		113: Setreuid,
		114: Setregid,
		115: Getgroups,
		116: Setgroups,
		117: Setresuid,
		118: Getresuid,
		119: Setresgid,
		120: Getresgid,
		121: Getpgid,

		124: Getsid,
		125: Capget,
		126: Capset,
		127: RtSigpending,
		128: RtSigtimedwait,
		129: RtSigqueueinfo,
		130: RtSigsuspend,
		131: Sigaltstack,
		132: Utime,
		133: Mknod,
		134: syscalls.Error(syscall.ENOSYS),
		135: syscalls.ErrorWithEvent(syscall.EINVAL),
		136: syscalls.ErrorWithEvent(syscall.ENOSYS),
		137: Statfs,
		138: Fstatfs,

		140: Getpriority,
		141: Setpriority,
		142: syscalls.CapError(linux.CAP_SYS_NICE),
		143: SchedGetparam,
		144: SchedSetscheduler,
		145: SchedGetscheduler,
		146: SchedGetPriorityMax,
		147: SchedGetPriorityMin,
		148: syscalls.ErrorWithEvent(syscall.EPERM),
		149: syscalls.Error(nil),
		150: syscalls.Error(nil),
		151: syscalls.Error(nil),
		152: syscalls.Error(nil),
		153: syscalls.CapError(linux.CAP_SYS_TTY_CONFIG),
		154: syscalls.Error(syscall.EPERM),
		155: syscalls.Error(syscall.EPERM),
		156: syscalls.Error(syscall.EPERM),
		157: Prctl,
		158: ArchPrctl,
		159: syscalls.CapError(linux.CAP_SYS_TIME),
		160: Setrlimit,
		161: Chroot,
		162: Sync,
		163: syscalls.CapError(linux.CAP_SYS_PACCT),
		164: syscalls.CapError(linux.CAP_SYS_TIME),
		165: Mount,
		166: Umount2,
		167: syscalls.CapError(linux.CAP_SYS_ADMIN),
		168: syscalls.CapError(linux.CAP_SYS_ADMIN),
		169: syscalls.CapError(linux.CAP_SYS_BOOT),
		170: Sethostname,
		171: Setdomainname,
		172: syscalls.CapError(linux.CAP_SYS_RAWIO),
		173: syscalls.CapError(linux.CAP_SYS_RAWIO),
		174: syscalls.CapError(linux.CAP_SYS_MODULE),
		175: syscalls.CapError(linux.CAP_SYS_MODULE),
		176: syscalls.CapError(linux.CAP_SYS_MODULE),
		177: syscalls.Error(syscall.ENOSYS),
		178: syscalls.Error(syscall.ENOSYS),
		179: syscalls.CapError(linux.CAP_SYS_ADMIN),
		180: syscalls.Error(syscall.ENOSYS),
		181: syscalls.Error(syscall.ENOSYS),
		182: syscalls.Error(syscall.ENOSYS),
		183: syscalls.Error(syscall.ENOSYS),
		184: syscalls.Error(syscall.ENOSYS),
		185: syscalls.Error(syscall.ENOSYS),
		186: Gettid,
		187: nil,
		188: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		189: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		190: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		191: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		192: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		193: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		194: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		195: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		196: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		197: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		198: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		199: syscalls.ErrorWithEvent(syscall.ENOTSUP),
		200: Tkill,
		201: Time,
		202: Futex,
		203: SchedSetaffinity,
		204: SchedGetaffinity,
		205: syscalls.Error(syscall.ENOSYS),
		206: IoSetup,
		207: IoDestroy,
		208: IoGetevents,
		209: IoSubmit,
		210: IoCancel,
		211: syscalls.Error(syscall.ENOSYS),
		212: syscalls.CapError(linux.CAP_SYS_ADMIN),
		213: EpollCreate,
		214: syscalls.ErrorWithEvent(syscall.ENOSYS),
		215: syscalls.ErrorWithEvent(syscall.ENOSYS),
		216: syscalls.ErrorWithEvent(syscall.ENOSYS),
		217: Getdents64,
		218: SetTidAddress,
		219: RestartSyscall,

		221: Fadvise64,

		227: ClockSettime,
		228: ClockGettime,
		229: ClockGetres,
		230: ClockNanosleep,
		231: ExitGroup,
		232: EpollWait,
		233: EpollCtl,
		234: Tgkill,
		235: Utimes,
		236: syscalls.Error(syscall.ENOSYS),
		237: syscalls.CapError(linux.CAP_SYS_NICE),
		238: SetMempolicy,
		239: GetMempolicy,

		246: syscalls.CapError(linux.CAP_SYS_BOOT),
		247: Waitid,
		248: syscalls.Error(syscall.EACCES),
		249: syscalls.Error(syscall.EACCES),
		250: syscalls.Error(syscall.EACCES),
		251: syscalls.CapError(linux.CAP_SYS_ADMIN),
		252: syscalls.CapError(linux.CAP_SYS_ADMIN),
		253: InotifyInit,
		254: InotifyAddWatch,
		255: InotifyRmWatch,
		256: syscalls.CapError(linux.CAP_SYS_NICE),
		257: Openat,
		258: Mkdirat,
		259: Mknodat,
		260: Fchownat,
		261: Futimesat,
		262: Fstatat,
		263: Unlinkat,
		264: Renameat,
		265: Linkat,
		266: Symlinkat,
		267: Readlinkat,
		268: Fchmodat,
		269: Faccessat,
		270: Pselect,
		271: Ppoll,
		272: Unshare,
		273: syscalls.Error(syscall.ENOSYS),
		274: syscalls.Error(syscall.ENOSYS),

		279: syscalls.CapError(linux.CAP_SYS_NICE),
		280: Utimensat,
		281: EpollPwait,

		283: TimerfdCreate,
		284: Eventfd,
		285: Fallocate,
		286: TimerfdSettime,
		287: TimerfdGettime,
		288: Accept4,

		290: Eventfd2,
		291: EpollCreate1,
		292: Dup3,
		293: Pipe2,
		294: InotifyInit1,
		295: Preadv,
		296: Pwritev,
		297: RtTgsigqueueinfo,
		298: syscalls.ErrorWithEvent(syscall.ENODEV),
		299: RecvMMsg,
		300: syscalls.ErrorWithEvent(syscall.ENOSYS),
		301: syscalls.ErrorWithEvent(syscall.ENOSYS),
		302: Prlimit64,
		303: syscalls.ErrorWithEvent(syscall.EOPNOTSUPP),
		304: syscalls.ErrorWithEvent(syscall.EOPNOTSUPP),
		305: syscalls.CapError(linux.CAP_SYS_TIME),
		306: Syncfs,
		307: SendMMsg,

		309: Getcpu,

		312: syscalls.CapError(linux.CAP_SYS_PTRACE),
		313: syscalls.CapError(linux.CAP_SYS_MODULE),

		318: GetRandom,
	},

	Emulate: map[usermem.Addr]uintptr{
		0xffffffffff600000: 96,
		0xffffffffff600400: 201,
		0xffffffffff600800: 309,
	},
	Missing: func(t *kernel.Task, sysno uintptr, args arch.SyscallArguments) (uintptr, error) {
		syscalls.UnimplementedEvent(t)
		return 0, syserror.ENOSYS
	},
}

AMD64 is a table of Linux amd64 syscall API with the corresponding syscall numbers from Linux 3.11. The entries commented out are those syscalls we don't currently support.

Functions

func Accept

Accept implements the linux syscall accept(2).

func Accept4

Accept4 implements the linux syscall accept4(2).

func Access

Access implements linux syscall access(2).

func Alarm

Alarm implements linux syscall alarm(2).

func ArchPrctl

ArchPrctl implements linux syscall arch_prctl(2). It sets architecture-specific process or thread state for t.

func Bind

Bind implements the linux syscall bind(2).

func Brk

Brk implements linux syscall brk(2).

func Capget

Capget implements Linux syscall capget.

func Capset

Capset implements Linux syscall capset.

func CaptureAddress

func CaptureAddress(t *kernel.Task, addr usermem.Addr, addrlen uint32) ([]byte, error)

CaptureAddress allocates memory for and copies a socket address structure from the untrusted address space range.

func Chdir

Chdir implements the linux syscall chdir(2).

func Chmod

Chmod implements linux syscall chmod(2).

func Chown

Chown implements linux syscall chown(2).

func Chroot

Chroot implements the linux syscall chroot(2).

func ClockGetres

ClockGetres implements linux syscall clock_getres(2).

func ClockGettime

func ClockGettime(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

ClockGettime implements linux syscall clock_gettime(2).

func ClockNanosleep

func ClockNanosleep(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

ClockNanosleep implements linux syscall clock_nanosleep(2).

func ClockSettime

ClockSettime implements linux syscall clock_settime(2).

func Clone

Clone implements linux syscall clone(2). sys_clone has so many flavors. We implement the default one in the current linux 3.11 x86_64:

sys_clone(clone_flags, newsp, parent_tidptr, child_tidptr, tls_val)

func Close

Close implements linux syscall close(2).

func Connect

Connect implements the linux syscall connect(2).

func CopyInMessageHeader64

func CopyInMessageHeader64(t *kernel.Task, addr usermem.Addr, msg *MessageHeader64) error

CopyInMessageHeader64 copies a message header from user to kernel memory.

func Creat

Creat implements linux syscall creat(2).

func Dup

Dup implements linux syscall dup(2).

func Dup2

Dup2 implements linux syscall dup2(2).

func Dup3

Dup3 implements linux syscall dup3(2).

func EpollCreate

EpollCreate implements the epoll_create(2) linux syscall.

func EpollCreate1

func EpollCreate1(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

EpollCreate1 implements the epoll_create1(2) linux syscall.

func EpollCtl

EpollCtl implements the epoll_ctl(2) linux syscall.

func EpollPwait

EpollPwait implements the epoll_pwait(2) linux syscall.

func EpollWait

EpollWait implements the epoll_wait(2) linux syscall.

func Eventfd

Eventfd implements linux syscall eventfd(2).

func Eventfd2

Eventfd2 implements linux syscall eventfd2(2).

func Execve

Execve implements linux syscall execve(2).

func Exit

Exit implements linux syscall exit(2).

func ExitGroup

ExitGroup implements linux syscall exit_group(2).

func Faccessat

Faccessat implements linux syscall faccessat(2).

func Fadvise64

Fadvise64 implements linux syscall fadvise64(2). This implementation currently ignores the provided advice.

func Fallocate

Fallocate implements linux system call fallocate(2). (well, not really, but at least we return the expected error codes)

func Fchdir

Fchdir implements the linux syscall fchdir(2).

func Fchmod

Fchmod implements linux syscall fchmod(2).

func Fchmodat

Fchmodat implements linux syscall fchmodat(2).

func Fchown

Fchown implements linux syscall fchown(2).

func Fchownat

Fchownat implements Linux syscall fchownat(2).

func Fcntl

Fcntl implements linux syscall fcntl(2).

func Fdatasync

Fdatasync implements linux syscall fdatasync(2).

At the moment, it just calls Fsync, which is a big hammer, but correct.

func Flock

Flock implements linux syscall flock(2).

func Fork

Fork implements Linux syscall fork(2).

func Fstat

Fstat implements linux syscall fstat(2).

func Fstatat

Fstatat implements linux syscall newfstatat, i.e. fstatat(2).

func Fstatfs

Fstatfs implements linux syscall fstatfs(2).

func Fsync

Fsync implements linux syscall fsync(2).

func Ftruncate

Ftruncate implements linux syscall ftruncate(2).

func Futex

Futex implements linux syscall futex(2). It provides a method for a program to wait for a value at a given address to change, and a method to wake up anyone waiting on a particular address.

func Futimesat

Futimesat implements linux syscall futimesat(2).

func GetMempolicy

func GetMempolicy(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

GetMempolicy implements the syscall get_mempolicy(2).

func GetPeerName

GetPeerName implements the linux syscall getpeername(2).

func GetRandom

GetRandom implements the linux syscall getrandom(2).

In a multi-tenant/shared environment, the only valid implementation is to fetch data from the urandom pool, otherwise starvation attacks become possible. The urandom pool is also expected to have plenty of entropy, thus the GRND_RANDOM flag is ignored. The GRND_NONBLOCK flag does not apply, as the pool will already be initialized.

func GetSockName

GetSockName implements the linux syscall getsockname(2).

func GetSockOpt

GetSockOpt implements the linux syscall getsockopt(2).

func Getcpu

Getcpu implements linux syscall getcpu(2).

func Getcwd

Getcwd implements the linux syscall getcwd(2).

func Getdents

Getdents implements linux syscall getdents(2) for 64bit systems.

func Getdents64

Getdents64 implements linux syscall getdents64(2).

func Getegid

Getegid implements the Linux syscall getegid.

func Geteuid

Geteuid implements the Linux syscall geteuid.

func Getgid

Getgid implements the Linux syscall getgid.

func Getgroups

Getgroups implements the Linux syscall getgroups.

func Getitimer

Getitimer implements linux syscall getitimer(2).

func Getpgid

Getpgid implements the linux syscall getpgid(2).

func Getpgrp

Getpgrp implements the linux syscall getpgrp(2).

func Getpid

Getpid implements linux syscall getpid(2).

func Getppid

Getppid implements linux syscall getppid(2).

func Getpriority

Getpriority pretends to implement the linux syscall getpriority(2).

This is a stub; real priorities require a full scheduler.

func Getresgid

Getresgid implements the Linux syscall getresgid.

func Getresuid

Getresuid implements the Linux syscall getresuid.

func Getrlimit

Getrlimit implements linux syscall getrlimit(2).

func Getrusage

Getrusage implements linux syscall getrusage(2).

marked "y" are supported now
marked "*" are not used on Linux
marked "p" are pending for support

y    struct timeval ru_utime; /* user CPU time used */
y    struct timeval ru_stime; /* system CPU time used */
p    long   ru_maxrss;        /* maximum resident set size */
*    long   ru_ixrss;         /* integral shared memory size */
*    long   ru_idrss;         /* integral unshared data size */
*    long   ru_isrss;         /* integral unshared stack size */
p    long   ru_minflt;        /* page reclaims (soft page faults) */
p    long   ru_majflt;        /* page faults (hard page faults) */
*    long   ru_nswap;         /* swaps */
p    long   ru_inblock;       /* block input operations */
p    long   ru_oublock;       /* block output operations */
*    long   ru_msgsnd;        /* IPC messages sent */
*    long   ru_msgrcv;        /* IPC messages received */
*    long   ru_nsignals;      /* signals received */
y    long   ru_nvcsw;         /* voluntary context switches */
y    long   ru_nivcsw;        /* involuntary context switches */

func Getsid

Getsid implements the linux syscall getsid(2).

func Gettid

Gettid implements linux syscall gettid(2).

func Gettimeofday

func Gettimeofday(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

Gettimeofday implements linux syscall gettimeofday(2).

func Getuid

Getuid implements the Linux syscall getuid.

func InotifyAddWatch

func InotifyAddWatch(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

InotifyAddWatch implements the inotify_add_watch() syscall.

func InotifyInit

InotifyInit implements the inotify_init() syscalls.

func InotifyInit1

func InotifyInit1(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

InotifyInit1 implements the inotify_init1() syscalls.

func InotifyRmWatch

func InotifyRmWatch(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

InotifyRmWatch implements the inotify_rm_watch() syscall.

func IoCancel

IoCancel implements linux syscall io_cancel(2).

It is not presently supported (ENOSYS indicates no support on this architecture).

func IoDestroy

IoDestroy implements linux syscall io_destroy(2).

func IoGetevents

IoGetevents implements linux syscall io_getevents(2).

func IoSetup

IoSetup implements linux syscall io_setup(2).

func IoSubmit

IoSubmit implements linux syscall io_submit(2).

func Ioctl

Ioctl implements linux syscall ioctl(2).

func Kill

Kill implements linux syscall kill(2).

func Lchown

Lchown implements linux syscall lchown(2).

Link implements linux syscall link(2).

func Linkat

Linkat implements linux syscall linkat(2).

func Listen

Listen implements the linux syscall listen(2).

func Lseek

Lseek implements linux syscall lseek(2).

func Lstat

Lstat implements linux syscall lstat(2).

func Madvise

Madvise implements linux syscall madvise(2).

func Mincore

Mincore implements the syscall mincore(2).

func Mkdir

Mkdir implements linux syscall mkdir(2).

func Mkdirat

Mkdirat implements linux syscall mkdirat(2).

func Mknod

Mknod implements the linux syscall mknod(2).

func Mknodat

Mknodat implements the linux syscall mknodat(2).

func Mmap

Mmap implements linux syscall mmap(2).

func Mount

Mount implements Linux syscall mount(2).

func Mprotect

Mprotect implements linux syscall mprotect(2).

func Mremap

Mremap implements linux syscall mremap(2).

func Msync

Msync implements Linux syscall msync(2).

func Munmap

Munmap implements linux syscall munmap(2).

func Nanosleep

Nanosleep implements linux syscall Nanosleep(2).

func Open

Open implements linux syscall open(2).

func Openat

Openat implements linux syscall openat(2).

func Pause

Pause implements linux syscall pause(2).

func Pipe

Pipe implements linux syscall pipe(2).

func Pipe2

Pipe2 implements linux syscall pipe2(2).

func Poll

Poll implements linux syscall poll(2).

func Ppoll

Ppoll implements linux syscall ppoll(2).

func Prctl

Prctl implements linux syscall prctl(2). It has a list of subfunctions which operate on the process. The arguments are all based on each subfunction.

func Pread64

Pread64 implements linux syscall pread64(2).

func Preadv

Preadv implements linux syscall preadv(2).

func Prlimit64

Prlimit64 implements linux syscall prlimit64(2).

func Pselect

Pselect implements linux syscall pselect(2).

func Ptrace

Ptrace implements linux system call ptrace(2).

func Pwrite64

Pwrite64 implements linux syscall pwrite64(2).

func Pwritev

Pwritev implements linux syscall pwritev(2).

func Read

Read implements linux syscall read(2). Note that we try to get a buffer that is exactly the size requested because some applications like qemu expect they can do large reads all at once. Bug for bug. Same for other read calls below.

Readlink implements linux syscall readlink(2).

func Readlinkat

Readlinkat implements linux syscall readlinkat(2).

func Readv

Readv implements linux syscall readv(2).

func RecvFrom

RecvFrom implements the linux syscall recvfrom(2).

func RecvMMsg

RecvMMsg implements the linux syscall recvmmsg(2).

func RecvMsg

RecvMsg implements the linux syscall recvmsg(2).

func Rename

Rename implements linux syscall rename(2).

func Renameat

Renameat implements linux syscall renameat(2).

func RestartSyscall

func RestartSyscall(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RestartSyscall implements the linux syscall restart_syscall(2).

func Rmdir

Rmdir implements linux syscall rmdir(2).

func RtSigaction

RtSigaction implements linux syscall rt_sigaction(2).

func RtSigpending

func RtSigpending(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RtSigpending implements linux syscall rt_sigpending(2).

func RtSigprocmask

func RtSigprocmask(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RtSigprocmask implements linux syscall rt_sigprocmask(2).

func RtSigqueueinfo

func RtSigqueueinfo(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RtSigqueueinfo implements linux syscall rt_sigqueueinfo(2).

func RtSigreturn

RtSigreturn implements linux syscall rt_sigreturn(2).

func RtSigsuspend

func RtSigsuspend(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RtSigsuspend implements linux syscall rt_sigsuspend(2).

func RtSigtimedwait

func RtSigtimedwait(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RtSigtimedwait implements linux syscall rt_sigtimedwait(2).

func RtTgsigqueueinfo

func RtTgsigqueueinfo(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

RtTgsigqueueinfo implements linux syscall rt_tgsigqueueinfo(2).

func SchedGetPriorityMax

func SchedGetPriorityMax(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedGetPriorityMax implements linux syscall sched_get_priority_max(2).

func SchedGetPriorityMin

func SchedGetPriorityMin(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedGetPriorityMin implements linux syscall sched_get_priority_min(2).

func SchedGetaffinity

func SchedGetaffinity(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedGetaffinity implements linux syscall sched_getaffinity(2).

func SchedGetparam

func SchedGetparam(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedGetparam implements linux syscall sched_getparam(2).

func SchedGetscheduler

func SchedGetscheduler(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedGetscheduler implements linux syscall sched_getscheduler(2).

func SchedSetaffinity

func SchedSetaffinity(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedSetaffinity implements linux syscall sched_setaffinity(2).

func SchedSetscheduler

func SchedSetscheduler(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SchedSetscheduler implements linux syscall sched_setscheduler(2).

func SchedYield

SchedYield implements linux syscall sched_yield(2).

func Select

Select implements linux syscall select(2).

func Semctl

Semctl handles: semctl(int semid, int semnum, int cmd, ...)

func Semget

Semget handles: semget(key_t key, int nsems, int semflg)

func Semop

Semop handles: semop(int semid, struct sembuf *sops, size_t nsops)

func SendMMsg

SendMMsg implements the linux syscall sendmmsg(2).

func SendMsg

SendMsg implements the linux syscall sendmsg(2).

func SendTo

SendTo implements the linux syscall sendto(2).

func Sendfile

Sendfile implements linux system call sendfile(2).

func SetMempolicy

func SetMempolicy(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SetMempolicy implements the syscall set_mempolicy(2).

func SetSockOpt

SetSockOpt implements the linux syscall setsockopt(2).

Note that unlike Linux, enabling SO_PASSCRED does not autobind the socket.

func SetTidAddress

func SetTidAddress(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

SetTidAddress implements linux syscall set_tid_address(2).

func Setdomainname

func Setdomainname(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

Setdomainname implements Linux syscall setdomainname.

func Setgid

Setgid implements the Linux syscall setgid.

func Setgroups

Setgroups implements the Linux syscall setgroups.

func Sethostname

Sethostname implements Linux syscall sethostname.

func Setitimer

Setitimer implements linux syscall setitimer(2).

func Setpgid

Setpgid implements the linux syscall setpgid(2).

func Setpriority

Setpriority pretends to implement the linux syscall setpriority(2).

This is a stub; real priorities require a full scheduler.

func Setregid

Setregid implements the Linux syscall setregid.

func Setresgid

Setresgid implements the Linux syscall setregid.

func Setresuid

Setresuid implements the Linux syscall setreuid.

func Setreuid

Setreuid implements the Linux syscall setreuid.

func Setrlimit

Setrlimit implements linux syscall setrlimit(2).

func Setsid

Setsid implements the linux syscall setsid(2).

func Setuid

Setuid implements the Linux syscall setuid.

func Shutdown

Shutdown implements the linux syscall shutdown(2).

func Sigaltstack

Sigaltstack implements linux syscall sigaltstack(2).

func Sigreturn

Sigreturn implements linux syscall sigreturn(2).

func Socket

Socket implements the linux syscall socket(2).

func SocketPair

SocketPair implements the linux syscall socketpair(2).

func Stat

Stat implements linux syscall stat(2).

func Statfs

Statfs implements linux syscall statfs(2).

Symlink implements linux syscall symlink(2).

func Symlinkat

Symlinkat implements linux syscall symlinkat(2).

func Sync

Sync implements linux system call sync(2).

func Syncfs

Syncfs implements linux system call syncfs(2).

func Sysinfo

Sysinfo implements the sysinfo syscall as described in man 2 sysinfo.

func Syslog

Syslog implements part of Linux syscall syslog.

Only the unpriviledged commands are implemented, allowing applications to read a fun dmesg.

func Tgkill

Tgkill implements linux syscall tgkill(2).

func Time

Time implements linux syscall time(2).

func TimerfdCreate

func TimerfdCreate(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

TimerfdCreate implements Linux syscall timerfd_create(2).

func TimerfdGettime

func TimerfdGettime(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

TimerfdGettime implements Linux syscall timerfd_gettime(2).

func TimerfdSettime

func TimerfdSettime(t *kernel.Task, args arch.SyscallArguments) (uintptr, *kernel.SyscallControl, error)

TimerfdSettime implements Linux syscall timerfd_settime(2).

func Times

Times implements linux syscall times(2).

func Tkill

Tkill implements linux syscall tkill(2).

func Truncate

Truncate implements linux syscall truncate(2).

func Umask

Umask implements linux syscall umask(2).

func Umount2

Umount2 implements Linux syscall umount2(2).

func Uname

Uname implements linux syscall uname.

Unlink implements linux syscall unlink(2).

func Unlinkat

Unlinkat implements linux syscall unlinkat(2).

func Unshare

Unshare implements linux syscall unshare(2).

func Utime

Utime implements linux syscall utime(2).

func Utimensat

Utimensat implements linux syscall utimensat(2).

func Utimes

Utimes implements linux syscall utimes(2).

func Vfork

Vfork implements Linux syscall vfork(2).

func Wait4

Wait4 implements linux syscall wait4(2).

func WaitPid

WaitPid implements linux syscall waitpid(2).

func Waitid

Waitid implements linux syscall waitid(2).

func Write

Write implements linux syscall write(2).

func Writev

Writev implements linux syscall writev(2).

Types

type ItimerType

type ItimerType int

ItimerType denotes the type of interval timer.

const (
	// ItimerReal equals to ITIMER_REAL.
	ItimerReal ItimerType = iota
	// ItimerVirtual equals to ITIMER_VIRTUAL.
	ItimerVirtual
	// ItimerProf equals to ITIMER_PROF.
	ItimerProf
)

Interval timer types from <sys/time.h>.

type MessageHeader64

type MessageHeader64 struct {
	// Name is the optional pointer to a network address buffer.
	Name uint64

	// NameLen is the length of the buffer pointed to by Name.
	NameLen uint32

	// Iov is a pointer to an array of io vectors that describe the memory
	// locations involved in the io operation.
	Iov uint64

	// IovLen is the length of the array pointed to by Iov.
	IovLen uint64

	// Control is the optional pointer to ancillary control data.
	Control uint64

	// ControlLen is the length of the data pointed to by Control.
	ControlLen uint64

	// Flags on the sent/received message.
	Flags int32
	// contains filtered or unexported fields
}

MessageHeader64 is the 64-bit representation of the msghdr struct used in the recvmsg and sendmsg syscalls.

type SchedParam

type SchedParam struct {
	// contains filtered or unexported fields
}

SchedParam replicates struct sched_param in sched.h.

Jump to

Keyboard shortcuts

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