authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-16 12:06:43 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2025-04-16 12:06:43 -07:00
log3a855256cddb75385eb6cb060512ddcee3857c49
tree50777ce4e319f118602878f47e93ede784eafdf7
parentd6168b08f21bafa6b7ec0b2cd366e50a21b3ab93

progress


1 files changed, 136 insertions(+), 0 deletions(-)

mod.zig+136
...@@ -100,210 +100,313 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -100,210 +100,313 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
100// int select(int nfds, fd_set *_Nullable restrict readfds, fd_set *_Nullable restrict writefds, fd_set *_Nullable restrict exceptfds, struct timeval *_Nullable restrict timeout);100// int select(int nfds, fd_set *_Nullable restrict readfds, fd_set *_Nullable restrict writefds, fd_set *_Nullable restrict exceptfds, struct timeval *_Nullable restrict timeout);
101101
102// sched_yield102// sched_yield
103// int sched_yield(void);
103104
104// mremap105// mremap
106// void *mremap(void old_address[.old_size], size_t old_size, size_t new_size, int flags, ... /* void *new_address */);
105107
106// msync108// msync
109// int msync(void addr[.length], size_t length, int flags);
107110
108// mincore111// mincore
112// int mincore(void addr[.length], size_t length, unsigned char *vec);
109113
110// madvise114// madvise
115// int madvise(void addr[.length], size_t length, int advice);
111116
112// shmget117// shmget
118// int shmget(key_t key, size_t size, int shmflg);
113119
114// shmat120// shmat
121// void *shmat(int shmid, const void *_Nullable shmaddr, int shmflg);
115122
116// shmctl123// shmctl
124// int shmctl(int shmid, int op, struct shmid_ds *buf);
117125
118// dup126// dup
127// int dup(int oldfd);
119128
120// dup2129// dup2
130// int dup2(int oldfd, int newfd);
121131
122// pause132// pause
133// int pause(void);
123134
124// nanosleep135// nanosleep
136// int nanosleep(const struct timespec *duration, struct timespec *_Nullable rem);
125137
126// getitimer138// getitimer
139// int getitimer(int which, struct itimerval *curr_value);
127140
128// alarm141// alarm
142// unsigned int alarm(unsigned int seconds);
129143
130// setitimer144// setitimer
145// int setitimer(int which, const struct itimerval *restrict new_value, struct itimerval *_Nullable restrict old_value);
131146
132// getpid147// getpid
148// pid_t getpid(void);
133149
134// sendfile150// sendfile
151// ssize_t sendfile(int out_fd, int in_fd, off_t *_Nullable offset, size_t count);
135152
136// socket153// socket
154// int socket(int domain, int type, int protocol);
137155
138// connect156// connect
157// int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
139158
140// accept159// accept
160// int accept(int sockfd, struct sockaddr *_Nullable restrict addr, socklen_t *_Nullable restrict addrlen);
141161
142// sendto162// sendto
163// ssize_t sendto(int sockfd, const void buf[.len], size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen);
143164
144// recvfrom165// recvfrom
166// ssize_t recvfrom(int sockfd, void buf[restrict .len], size_t len, int flags, struct sockaddr *_Nullable restrict src_addr, socklen_t *_Nullable restrict addrlen);
145167
146// sendmsg168// sendmsg
169// ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags);
147170
148// recvmsg171// recvmsg
172// ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
149173
150// shutdown174// shutdown
175// int shutdown(int sockfd, int how);
151176
152// bind177// bind
178// int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
153179
154// listen180// listen
181// int listen(int sockfd, int backlog);
155182
156// getsockname183// getsockname
184// int getsockname(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen);
157185
158// getpeername186// getpeername
187// int getpeername(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen);
159188
160// socketpair189// socketpair
190// int socketpair(int domain, int type, int protocol, int sv[2]);
161191
162// setsockopt192// setsockopt
193// int setsockopt(int sockfd, int level, int optname, const void optval[.optlen], socklen_t optlen);
163194
164// getsockopt195// getsockopt
196// int getsockopt(int sockfd, int level, int optname, void optval[restrict *.optlen], socklen_t *restrict optlen);
165197
166// clone198// clone
199// int clone(int (*fn)(void *_Nullable), void *stack, int flags, void *_Nullable arg, ... /* pid_t *_Nullable parent_tid, void *_Nullable tls, pid_t *_Nullable child_tid */ );
167200
168// fork201// fork
202// pid_t fork(void);
169203
170// vfork204// vfork
205// pid_t vfork(void);
171206
172// execve207// execve
208// int execve(const char *pathname, char *const _Nullable argv[], char *const _Nullable envp[]);
173209
174// exit210// exit
211// [[noreturn]] void _exit(int status);
175212
176// wait4213// wait4
214// pid_t wait4(pid_t pid, int *_Nullable wstatus, int options, struct rusage *_Nullable rusage);
177215
178// kill216// kill
217// int kill(pid_t pid, int sig);
179218
180// uname219// uname
220// int uname(struct utsname *buf);
181221
182// semget222// semget
223// int semget(key_t key, int nsems, int semflg);
183224
184// semop225// semop
226// int semop(int semid, struct sembuf *sops, size_t nsops);
185227
186// semctl228// semctl
229// int semctl(int semid, int semnum, int op, ...);
187230
188// shmdt231// shmdt
232// int shmdt(const void *shmaddr);
189233
190// msgget234// msgget
235// int msgget(key_t key, int msgflg);
191236
192// msgsnd237// msgsnd
238// int msgsnd(int msqid, const void msgp[.msgsz], size_t msgsz, int msgflg);
193239
194// msgrcv240// msgrcv
241// ssize_t msgrcv(int msqid, void msgp[.msgsz], size_t msgsz, long msgtyp, int msgflg);
195242
196// msgctl243// msgctl
244// int msgctl(int msqid, int op, struct msqid_ds *buf);
197245
198// fcntl246// fcntl
247// int fcntl(int fd, int op, ... /* arg */ );
199248
200// flock249// flock
250// int flock(int fd, int op);
201251
202// fsync252// fsync
253// int fsync(int fd);
203254
204// fdatasync255// fdatasync
256// int fdatasync(int fd);
205257
206// truncate258// truncate
259// int truncate(const char *path, off_t length);
207260
208// ftruncate261// ftruncate
262// int ftruncate(int fd, off_t length);
209263
210// getdents264// getdents
265// ssize_t getdents64(int fd, void dirp[.count], size_t count);
211266
212// getcwd267// getcwd
268// char *getcwd(char buf[.size], size_t size);
213269
214// chdir270// chdir
271// int chdir(const char *path);
215272
216// fchdir273// fchdir
274// int fchdir(int fd);
217275
218// rename276// rename
277// int rename(const char *oldpath, const char *newpath);
219278
220// mkdir279// mkdir
280// int mkdir(const char *pathname, mode_t mode);
221281
222// rmdir282// rmdir
283// int rmdir(const char *pathname);
223284
224// creat285// creat
286// int creat(const char *pathname, mode_t mode);
225287
226// link288// link
289// int link(const char *oldpath, const char *newpath);
227290
228// unlink291// unlink
292// int unlink(const char *pathname);
229293
230// symlink294// symlink
295// int symlink(const char *target, const char *linkpath);
231296
232// readlink297// readlink
298// ssize_t readlink(const char *restrict pathname, char *restrict buf, size_t bufsiz);
233299
234// chmod300// chmod
301// int chmod(const char *pathname, mode_t mode);
235302
236// fchmod303// fchmod
304// int fchmod(int fd, mode_t mode);
237305
238// chown306// chown
307// int chown(const char *pathname, uid_t owner, gid_t group);
239308
240// fchown309// fchown
310// int fchown(int fd, uid_t owner, gid_t group);
241311
242// lchown312// lchown
313// int lchown(const char *pathname, uid_t owner, gid_t group);
243314
244// umask315// umask
316// mode_t umask(mode_t mask);
245317
246// gettimeofday318// gettimeofday
319// int gettimeofday(struct timeval *restrict tv, struct timezone *_Nullable restrict tz);
247320
248// getrlimit321// getrlimit
322// int getrlimit(int resource, struct rlimit *rlim);
249323
250// getrusage324// getrusage
325// int getrusage(int who, struct rusage *usage);
251326
252// sysinfo327// sysinfo
328// int sysinfo(struct sysinfo *info);
253329
254// times330// times
331// clock_t times(struct tms *buf);
255332
256// ptrace333// ptrace
334// long ptrace(enum __ptrace_request op, pid_t pid, void *addr, void *data);
257335
258// getuid336// getuid
337// uid_t getuid(void);
259338
260// syslog339// syslog
340// int syscall(SYS_syslog, int type, char *bufp, int len);
261341
262// getgid342// getgid
343// gid_t getgid(void);
263344
264// setuid345// setuid
346// int setuid(uid_t uid);
265347
266// setgid348// setgid
349// int setgid(gid_t gid);
267350
268// geteuid351// geteuid
352// uid_t geteuid(void);
269353
270// getegid354// getegid
355// gid_t getegid(void);
271356
272// setpgid357// setpgid
358// int setpgid(pid_t pid, pid_t pgid);
273359
274// getppid360// getppid
361// pid_t getppid(void);
275362
276// getpgrp363// getpgrp
364// pid_t getpgrp(void);
277365
278// setsid366// setsid
367// pid_t setsid(void);
279368
280// setreuid369// setreuid
370// int setreuid(uid_t ruid, uid_t euid);
281371
282// setregid372// setregid
373// int setregid(gid_t rgid, gid_t egid);
283374
284// getgroups375// getgroups
376// int getgroups(int size, gid_t list[]);
285377
286// setgroups378// setgroups
379// int setgroups(size_t size, const gid_t *_Nullable list);
287380
288// setresuid381// setresuid
382// int setresuid(uid_t ruid, uid_t euid, uid_t suid);
289383
290// getresuid384// getresuid
385// int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
291386
292// setresgid387// setresgid
388// int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
293389
294// getresgid390// getresgid
391// int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
295392
296// getpgid393// getpgid
394// pid_t getpgid(pid_t pid);
297395
298// setfsuid396// setfsuid
397// [[deprecated]] int setfsuid(uid_t fsuid);
299398
300// setfsgid399// setfsgid
400// [[deprecated]] int setfsgid(gid_t fsgid);
301401
302// getsid402// getsid
403// pid_t getsid(pid_t pid);
303404
304// capget405// capget
406// int syscall(SYS_capget, cap_user_header_t hdrp, cap_user_data_t datap);
305407
306// capset408// capset
409// int syscall(SYS_capset, cap_user_header_t hdrp, const cap_user_data_t datap);
307410
308// rt_sigpending411// rt_sigpending
309412
...@@ -314,40 +417,57 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -314,40 +417,57 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
314// rt_sigsuspend417// rt_sigsuspend
315418
316// sigaltstack419// sigaltstack
420// int sigaltstack(const stack_t *_Nullable restrict ss, stack_t *_Nullable restrict old_ss);
317421
318// utime422// utime
423// int utime(const char *filename, const struct utimbuf *_Nullable times);
319424
320// mknod425// mknod
426// int mknod(const char *pathname, mode_t mode, dev_t dev);
321427
322// uselib428// uselib
429// [[deprecated]] int uselib(const char *library);
323430
324// personality431// personality
432// int personality(unsigned long persona);
325433
326// ustat434// ustat
435// [[deprecated]] int ustat(dev_t dev, struct ustat *ubuf);
327436
328// statfs437// statfs
438// int statfs(const char *path, struct statfs *buf);
329439
330// fstatfs440// fstatfs
441// int fstatfs(int fd, struct statfs *buf);
331442
332// sysfs443// sysfs
333444
334// getpriority445// getpriority
446// int getpriority(int which, id_t who);
335447
336// setpriority448// setpriority
449// int setpriority(int which, id_t who, int prio);
337450
338// sched_setparam451// sched_setparam
452// int sched_setparam(pid_t pid, const struct sched_param *param);
339453
340// sched_getparam454// sched_getparam
455// int sched_getparam(pid_t pid, struct sched_param *param);
341456
342// sched_setscheduler457// sched_setscheduler
458// int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param);
343459
344// sched_getscheduler460// sched_getscheduler
461// int sched_getscheduler(pid_t pid);
345462
346// sched_get_priority_max463// sched_get_priority_max
464// int sched_get_priority_max(int policy);
347465
348// sched_get_priority_min466// sched_get_priority_min
467// int sched_get_priority_min(int policy);
349468
350// sched_rr_get_interval469// sched_rr_get_interval
470// int sched_rr_get_interval(pid_t pid, struct timespec *tp);
351471
352// mlock472// mlock
353473
...@@ -372,6 +492,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -372,6 +492,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
372// adjtimex492// adjtimex
373493
374// setrlimit494// setrlimit
495// int setrlimit(int resource, const struct rlimit *rlim);
375496
376// chroot497// chroot
377498
...@@ -380,6 +501,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -380,6 +501,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
380// acct501// acct
381502
382// settimeofday503// settimeofday
504// int settimeofday(const struct timeval *tv, const struct timezone *_Nullable tz);
383505
384// mount506// mount
385507
...@@ -522,6 +644,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -522,6 +644,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
522// tgkill644// tgkill
523645
524// utimes646// utimes
647// int utimes(const char *filename, const struct timeval times[_Nullable 2]);
525648
526// vserver649// vserver
527650
...@@ -569,8 +692,10 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -569,8 +692,10 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
569// int openat(int dirfd, const char *pathname, int flags, ... /* mode_t mode */ );692// int openat(int dirfd, const char *pathname, int flags, ... /* mode_t mode */ );
570693
571// mkdirat694// mkdirat
695// int mkdirat(int dirfd, const char *pathname, mode_t mode);
572696
573// mknodat697// mknodat
698// int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);
574699
575// fchownat700// fchownat
576701
...@@ -580,16 +705,22 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -580,16 +705,22 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
580// int fstatat(int dirfd, const char *restrict pathname, struct stat *restrict statbuf, int flags);705// int fstatat(int dirfd, const char *restrict pathname, struct stat *restrict statbuf, int flags);
581706
582// unlinkat707// unlinkat
708// int unlinkat(int dirfd, const char *pathname, int flags);
583709
584// renameat710// renameat
711// int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
585712
586// linkat713// linkat
714// int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags);
587715
588// symlinkat716// symlinkat
717// int symlinkat(const char *target, int newdirfd, const char *linkpath);
589718
590// readlinkat719// readlinkat
720// ssize_t readlinkat(int dirfd, const char *restrict pathname, char *restrict buf, size_t bufsiz);
591721
592// fchmodat722// fchmodat
723// int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags);
593724
594// faccessat725// faccessat
595// int faccessat(int dirfd, const char *pathname, int mode, int flags);726// int faccessat(int dirfd, const char *pathname, int mode, int flags);
...@@ -601,6 +732,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -601,6 +732,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
601// int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *_Nullable tmo_p, const sigset_t *_Nullable sigmask);732// int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *_Nullable tmo_p, const sigset_t *_Nullable sigmask);
602733
603// unshare734// unshare
735// int unshare(int flags);
604736
605// set_robust_list737// set_robust_list
606738
...@@ -633,6 +765,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -633,6 +765,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
633// timerfd_gettime765// timerfd_gettime
634766
635// accept4767// accept4
768// int accept4(int sockfd, struct sockaddr *_Nullable restrict addr, socklen_t *_Nullable restrict addrlen, int flags);
636769
637// signalfd4770// signalfd4
638771
...@@ -641,6 +774,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -641,6 +774,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
641// epoll_create1774// epoll_create1
642775
643// dup3776// dup3
777// int dup3(int oldfd, int newfd, int flags);
644778
645// pipe2779// pipe2
646// int pipe2(int pipefd[2], int flags);780// int pipe2(int pipefd[2], int flags);
...@@ -664,6 +798,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -664,6 +798,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
664// fanotify_mark798// fanotify_mark
665799
666// prlimit64800// prlimit64
801// int prlimit(pid_t pid, int resource, const struct rlimit *_Nullable new_limit, struct rlimit *_Nullable old_limit);
667802
668// name_to_handle_at803// name_to_handle_at
669804
...@@ -692,6 +827,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {...@@ -692,6 +827,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
692// sched_getattr827// sched_getattr
693828
694// renameat2829// renameat2
830// int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags);
695831
696// seccomp832// seccomp
697833