1#ifndef WIRED_ARCH_SYSOPS_H
2#define WIRED_ARCH_SYSOPS_H
19 i64 dirfd,
const char* path,
i64 flags,
i64 mode) {
43 i64 dirfd,
const char* path,
void* st,
i64 flags) {
70 i64 fd,
i64 level,
i64 opt,
void* val,
void* len) {
76 i64 fd,
const void* buf,
usz n,
i64 flags,
const void* addr,
i64 alen) {
82 i64 fd,
void* buf,
usz n,
i64 flags,
void* addr,
void* alen) {
94 i64 fd,
void* vec,
usz n,
i64 flags,
void* timeout) {
138 i64 pid,
void* status,
i64 opts,
void* rusage) {
163 void* uaddr,
i64 op,
i64 val,
void* timeout,
void* uaddr2,
i64 val3) {
185 i64 pid,
i64 len,
const void* mask) {
191 i64 sig,
const void* act,
void* old,
i64 setsize) {
197 i64 how,
const void* set,
void* old,
i64 setsize) {
205 const void* set,
void* info,
const void* ts,
i64 setsize) {
static i64 wired_arch_exit_group(i64 code)
exit_group(2): ends every thread in the process.
Definition sysops.h:129
static i64 wired_arch_sendto(i64 fd, const void *buf, usz n, i64 flags, const void *addr, i64 alen)
sendto(2): addr may be 0/len 0 for connected-style sends.
Definition sysops.h:75
static i64 wired_arch_mmap(i64 addr, usz len, i64 prot, i64 flags, i64 fd, u64 off)
mmap(2): addresses as i64 (x86_64 user addresses are never negative, so < 0 on the return is the erro...
Definition sysops.h:110
static i64 wired_arch_bpf(i64 cmd, void *attr, i64 size)
bpf(2): attr is a kernel union bpf_attr of size bytes.
Definition sysops.h:210
static i64 wired_arch_fcntl(i64 fd, i64 cmd, i64 arg)
fcntl(2).
Definition sysops.h:104
static i64 wired_arch_getpid(void)
getpid(2).
Definition sysops.h:148
static i64 wired_arch_fork(void)
fork(2).
Definition sysops.h:134
static i64 wired_arch_getppid(void)
getppid(2).
Definition sysops.h:151
static i64 wired_arch_rt_sigaction(i64 sig, const void *act, void *old, i64 setsize)
rt_sigaction(2): act/old are kernel_sigaction (not glibc's).
Definition sysops.h:190
static i64 wired_arch_wait4(i64 pid, void *status, i64 opts, void *rusage)
wait4(2).
Definition sysops.h:137
static i64 wired_arch_mprotect(i64 addr, i64 len, i64 prot)
mprotect(2).
Definition sysops.h:116
static i64 wired_arch_sendmsg(i64 fd, const void *msg, i64 flags)
sendmsg(2): msg is a kernel struct msghdr.
Definition sysops.h:88
static i64 wired_arch_mkdirat(i64 dirfd, const char *path, i64 mode)
mkdirat(2).
Definition sysops.h:48
static i64 wired_arch_close(i64 fd)
close(2).
Definition sysops.h:24
static i64 wired_arch_pread64(i64 fd, void *buf, usz n, u64 off)
pread64(2): read at an explicit offset, file position unmoved.
Definition sysops.h:37
static i64 wired_arch_read(i64 fd, void *buf, usz n)
read(2).
Definition sysops.h:27
static i64 wired_arch_clock_gettime(i64 clkid, void *ts)
clock_gettime(2): ts is a kernel struct timespec.
Definition sysops.h:169
static i64 wired_arch_sched_setaffinity(i64 pid, i64 len, const void *mask)
sched_setaffinity(2).
Definition sysops.h:184
static i64 wired_arch_bind(i64 fd, const void *addr, i64 len)
bind(2): addr is a kernel sockaddr of len bytes.
Definition sysops.h:58
static i64 wired_arch_recvfrom(i64 fd, void *buf, usz n, i64 flags, void *addr, void *alen)
recvfrom(2): addr/alen may be 0 when the sender is not needed.
Definition sysops.h:81
static i64 wired_arch_getsockopt(i64 fd, i64 level, i64 opt, void *val, void *len)
getsockopt(2): len is an in/out i32*.
Definition sysops.h:69
static i64 wired_arch_rt_sigtimedwait(const void *set, void *info, const void *ts, i64 setsize)
rt_sigtimedwait(2): wait for a signal in the u64 bitmap set (which must be blocked); info/ts may be 0...
Definition sysops.h:204
static i64 wired_arch_munmap(i64 addr, usz len)
munmap(2).
Definition sysops.h:121
static i64 wired_arch_openat(i64 dirfd, const char *path, i64 flags, i64 mode)
openat(2): open path relative to dirfd.
Definition sysops.h:18
static i64 wired_arch_futex(void *uaddr, i64 op, i64 val, void *timeout, void *uaddr2, i64 val3)
futex(2).
Definition sysops.h:162
static i64 wired_arch_newfstatat(i64 dirfd, const char *path, void *st, i64 flags)
newfstatat(2): stat path (kernel struct stat into st).
Definition sysops.h:42
static i64 wired_arch_rt_sigprocmask(i64 how, const void *set, void *old, i64 setsize)
rt_sigprocmask(2): set/old are u64 signal bitmaps.
Definition sysops.h:196
static i64 wired_arch_kill(i64 pid, i64 sig)
kill(2).
Definition sysops.h:143
static i64 wired_arch_socket(i64 domain, i64 type, i64 protocol)
socket(2).
Definition sysops.h:53
static i64 wired_arch_gettid(void)
gettid(2).
Definition sysops.h:159
static i64 wired_arch_getrandom(void *buf, usz n, i64 flags)
getrandom(2).
Definition sysops.h:174
static i64 wired_arch_exit(i64 code)
exit(2): ends the calling thread (last thread ends the process).
Definition sysops.h:126
static i64 wired_arch_setsockopt(i64 fd, i64 level, i64 opt, const void *val, i64 len)
setsockopt(2).
Definition sysops.h:63
static i64 wired_arch_write(i64 fd, const void *buf, usz n)
write(2).
Definition sysops.h:32
static i64 wired_arch_recvmmsg(i64 fd, void *vec, usz n, i64 flags, void *timeout)
recvmmsg(2): vec is a kernel struct mmsghdr array of n entries.
Definition sysops.h:93
static i64 wired_arch_poll(void *fds, i64 nfds, i64 timeout_ms)
poll(2): fds is a kernel struct pollfd array.
Definition sysops.h:99
static i64 wired_arch_sched_getaffinity(i64 pid, i64 len, void *mask)
sched_getaffinity(2): mask is a cpu bitmap of len bytes.
Definition sysops.h:179
static i64 wired_arch_prctl(i64 op, i64 arg2)
prctl(2).
Definition sysops.h:154
long i64
signed 64-bit integer
Definition types.h:14
u64 usz
unsigned size (size_t equivalent)
Definition types.h:20
unsigned long u64
unsigned 64-bit integer
Definition types.h:13
x86-64 Linux architecture adapter: every ISA-specific construct the SDK needs, behind the arch-neutra...
#define SYS_mprotect
mprotect(2) syscall number
Definition x8664.h:20
#define SYS_bpf
bpf(2) syscall number
Definition x8664.h:53
#define SYS_getsockopt
getsockopt(2) syscall number
Definition x8664.h:51
#define SYS_recvmmsg
recvmmsg(2) syscall number
Definition x8664.h:31
#define SYS_getrandom
getrandom(2) syscall number
Definition x8664.h:42
#define syscall4(n, a, b, c, d)
Four-argument syscall: syscall6() with the trailing arguments zeroed.
Definition x8664.h:95
#define SYS_read
read(2) syscall number
Definition x8664.h:14
#define SYS_sendto
sendto(2) syscall number
Definition x8664.h:28
#define SYS_sched_getaffinity
sched_getaffinity(2) syscall number
Definition x8664.h:38
#define syscall5(n, a, b, c, d, e)
Five-argument syscall: syscall6() with the trailing argument zeroed.
Definition x8664.h:98
#define SYS_bind
bind(2) syscall number
Definition x8664.h:30
#define SYS_poll
poll(2) syscall number
Definition x8664.h:50
static i64 syscall6(i64 n, i64 a, i64 b, i64 c, i64 d, i64 e, i64 f)
Six-argument raw x86_64 Linux syscall.
Definition x8664.h:77
#define SYS_fork
fork(2) syscall number
Definition x8664.h:43
#define SYS_sched_setaffinity
sched_setaffinity(2) syscall number
Definition x8664.h:37
#define SYS_exit_group
exit_group(2) syscall number
Definition x8664.h:49
#define syscall2(n, a, b)
Two-argument syscall: syscall6() with the trailing arguments zeroed.
Definition x8664.h:90
#define SYS_getppid
getppid(2) syscall number
Definition x8664.h:47
#define SYS_getpid
getpid(2) syscall number
Definition x8664.h:46
#define SYS_newfstatat
newfstatat(2) syscall number
Definition x8664.h:17
#define SYS_close
close(2) syscall number
Definition x8664.h:16
#define SYS_rt_sigaction
rt_sigaction(2) syscall number
Definition x8664.h:22
#define SYS_munmap
munmap(2) syscall number
Definition x8664.h:21
#define SYS_clock_gettime
clock_gettime(2) syscall number
Definition x8664.h:39
#define SYS_fcntl
fcntl(2) syscall number
Definition x8664.h:52
#define SYS_futex
futex(2) syscall number
Definition x8664.h:36
#define SYS_gettid
gettid(2) syscall number
Definition x8664.h:35
#define SYS_recvfrom
recvfrom(2) syscall number
Definition x8664.h:29
#define SYS_exit
exit(2) syscall number
Definition x8664.h:34
#define SYS_write
write(2) syscall number
Definition x8664.h:15
#define SYS_sendmsg
sendmsg(2) syscall number
Definition x8664.h:27
#define SYS_setsockopt
setsockopt(2) syscall number
Definition x8664.h:32
#define SYS_socket
socket(2) syscall number
Definition x8664.h:26
#define SYS_prctl
prctl(2) syscall number
Definition x8664.h:48
#define SYS_mkdirat
mkdirat(2) syscall number
Definition x8664.h:41
#define SYS_wait4
wait4(2) syscall number
Definition x8664.h:44
#define SYS_rt_sigtimedwait
rt_sigtimedwait(2) syscall number
Definition x8664.h:25
#define SYS_pread64
pread64(2) syscall number
Definition x8664.h:18
#define SYS_openat
openat(2) syscall number
Definition x8664.h:40
#define syscall1(n, a)
One-argument syscall: syscall6() with the trailing arguments zeroed.
Definition x8664.h:101
#define SYS_mmap
mmap(2) syscall number
Definition x8664.h:19
#define SYS_rt_sigprocmask
rt_sigprocmask(2) syscall number
Definition x8664.h:23
#define SYS_kill
kill(2) syscall number
Definition x8664.h:45
#define syscall3(n, a, b, c)
Three-argument syscall: syscall6() with the trailing arguments zeroed.
Definition x8664.h:92