|
wired
libc-free QUIC/HTTP3 SDK in C for x86_64-linux
|
Typed wrappers over the raw syscall layer – the only place outside the arch instruction sequences where syscallN(SYS_*) may appear. More...
#include "common/arch/x8664/x8664.h"Go to the source code of this file.
Functions | |
| static i64 | wired_arch_openat (i64 dirfd, const char *path, i64 flags, i64 mode) |
openat(2): open path relative to dirfd. | |
| static i64 | wired_arch_close (i64 fd) |
| close(2). | |
| static i64 | wired_arch_read (i64 fd, void *buf, usz n) |
| read(2). | |
| static i64 | wired_arch_write (i64 fd, const void *buf, usz n) |
| write(2). | |
| static i64 | wired_arch_pread64 (i64 fd, void *buf, usz n, u64 off) |
| pread64(2): read at an explicit offset, file position unmoved. | |
| static i64 | wired_arch_newfstatat (i64 dirfd, const char *path, void *st, i64 flags) |
newfstatat(2): stat path (kernel struct stat into st). | |
| static i64 | wired_arch_mkdirat (i64 dirfd, const char *path, i64 mode) |
| mkdirat(2). | |
| static i64 | wired_arch_socket (i64 domain, i64 type, i64 protocol) |
| socket(2). | |
| static i64 | wired_arch_bind (i64 fd, const void *addr, i64 len) |
bind(2): addr is a kernel sockaddr of len bytes. | |
| static i64 | wired_arch_setsockopt (i64 fd, i64 level, i64 opt, const void *val, i64 len) |
| setsockopt(2). | |
| static i64 | wired_arch_getsockopt (i64 fd, i64 level, i64 opt, void *val, void *len) |
getsockopt(2): len is an in/out i32*. | |
| 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. | |
| static i64 | wired_arch_recvfrom (i64 fd, void *buf, usz n, i64 flags, void *addr, void *alen) |
recvfrom(2): addr/ be 0 when the sender is not needed. | |
| static i64 | wired_arch_sendmsg (i64 fd, const void *msg, i64 flags) |
sendmsg(2): msg is a kernel struct msghdr. | |
| 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. | |
| static i64 | wired_arch_poll (void *fds, i64 nfds, i64 timeout_ms) |
poll(2): fds is a kernel struct pollfd array. | |
| static i64 | wired_arch_fcntl (i64 fd, i64 cmd, i64 arg) |
| fcntl(2). | |
| 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 error test). | |
| static i64 | wired_arch_mprotect (i64 addr, i64 len, i64 prot) |
| mprotect(2). | |
| static i64 | wired_arch_munmap (i64 addr, usz len) |
| munmap(2). | |
| static i64 | wired_arch_exit (i64 code) |
| exit(2): ends the calling thread (last thread ends the process). | |
| static i64 | wired_arch_exit_group (i64 code) |
| exit_group(2): ends every thread in the process. | |
| static i64 | wired_arch_fork (void) |
| fork(2). | |
| static i64 | wired_arch_wait4 (i64 pid, void *status, i64 opts, void *rusage) |
| wait4(2). | |
| static i64 | wired_arch_kill (i64 pid, i64 sig) |
| kill(2). | |
| static i64 | wired_arch_getpid (void) |
| getpid(2). | |
| static i64 | wired_arch_getppid (void) |
| getppid(2). | |
| static i64 | wired_arch_prctl (i64 op, i64 arg2) |
| prctl(2). | |
| static i64 | wired_arch_gettid (void) |
| gettid(2). | |
| static i64 | wired_arch_futex (void *uaddr, i64 op, i64 val, void *timeout, void *uaddr2, i64 val3) |
| futex(2). | |
| static i64 | wired_arch_clock_gettime (i64 clkid, void *ts) |
clock_gettime(2): ts is a kernel struct timespec. | |
| static i64 | wired_arch_getrandom (void *buf, usz n, i64 flags) |
| getrandom(2). | |
| static i64 | wired_arch_sched_getaffinity (i64 pid, i64 len, void *mask) |
sched_getaffinity(2): mask is a cpu bitmap of len bytes. | |
| static i64 | wired_arch_sched_setaffinity (i64 pid, i64 len, const void *mask) |
| sched_setaffinity(2). | |
| static i64 | wired_arch_rt_sigaction (i64 sig, const void *act, void *old, i64 setsize) |
rt_sigaction(2): act/ kernel_sigaction (not glibc's). | |
| static i64 | wired_arch_rt_sigprocmask (i64 how, const void *set, void *old, i64 setsize) |
rt_sigprocmask(2): set/ u64 signal bitmaps. | |
| 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/ be 0 (no siginfo, no timeout). | |
| static i64 | wired_arch_bpf (i64 cmd, void *attr, i64 size) |
bpf(2): attr is a kernel union bpf_attr of size bytes. | |
Typed wrappers over the raw syscall layer – the only place outside the arch instruction sequences where syscallN(SYS_*) may appear.
Every domain calls kernel functionality through these wired_arch_* names; the wrappers stay deliberately thin: kernel argument order, pointers as void* (callers keep their own struct definitions), lengths as usz and file offsets as u64 (cast to the raw i64 here), and the kernel's raw i64 return where negative values are -errno.