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 {
100100// 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
102102// sched_yield
103// int sched_yield(void);
103104
104105// mremap
106// void *mremap(void old_address[.old_size], size_t old_size, size_t new_size, int flags, ... /* void *new_address */);
105107
106108// msync
109// int msync(void addr[.length], size_t length, int flags);
107110
108111// mincore
112// int mincore(void addr[.length], size_t length, unsigned char *vec);
109113
110114// madvise
115// int madvise(void addr[.length], size_t length, int advice);
111116
112117// shmget
118// int shmget(key_t key, size_t size, int shmflg);
113119
114120// shmat
121// void *shmat(int shmid, const void *_Nullable shmaddr, int shmflg);
115122
116123// shmctl
124// int shmctl(int shmid, int op, struct shmid_ds *buf);
117125
118126// dup
127// int dup(int oldfd);
119128
120129// dup2
130// int dup2(int oldfd, int newfd);
121131
122132// pause
133// int pause(void);
123134
124135// nanosleep
136// int nanosleep(const struct timespec *duration, struct timespec *_Nullable rem);
125137
126138// getitimer
139// int getitimer(int which, struct itimerval *curr_value);
127140
128141// alarm
142// unsigned int alarm(unsigned int seconds);
129143
130144// setitimer
145// int setitimer(int which, const struct itimerval *restrict new_value, struct itimerval *_Nullable restrict old_value);
131146
132147// getpid
148// pid_t getpid(void);
133149
134150// sendfile
151// ssize_t sendfile(int out_fd, int in_fd, off_t *_Nullable offset, size_t count);
135152
136153// socket
154// int socket(int domain, int type, int protocol);
137155
138156// connect
157// int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
139158
140159// accept
160// int accept(int sockfd, struct sockaddr *_Nullable restrict addr, socklen_t *_Nullable restrict addrlen);
141161
142162// 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
144165// 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
146168// sendmsg
169// ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags);
147170
148171// recvmsg
172// ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags);
149173
150174// shutdown
175// int shutdown(int sockfd, int how);
151176
152177// bind
178// int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
153179
154180// listen
181// int listen(int sockfd, int backlog);
155182
156183// getsockname
184// int getsockname(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen);
157185
158186// getpeername
187// int getpeername(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen);
159188
160189// socketpair
190// int socketpair(int domain, int type, int protocol, int sv[2]);
161191
162192// setsockopt
193// int setsockopt(int sockfd, int level, int optname, const void optval[.optlen], socklen_t optlen);
163194
164195// getsockopt
196// int getsockopt(int sockfd, int level, int optname, void optval[restrict *.optlen], socklen_t *restrict optlen);
165197
166198// 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
168201// fork
202// pid_t fork(void);
169203
170204// vfork
205// pid_t vfork(void);
171206
172207// execve
208// int execve(const char *pathname, char *const _Nullable argv[], char *const _Nullable envp[]);
173209
174210// exit
211// [[noreturn]] void _exit(int status);
175212
176213// wait4
214// pid_t wait4(pid_t pid, int *_Nullable wstatus, int options, struct rusage *_Nullable rusage);
177215
178216// kill
217// int kill(pid_t pid, int sig);
179218
180219// uname
220// int uname(struct utsname *buf);
181221
182222// semget
223// int semget(key_t key, int nsems, int semflg);
183224
184225// semop
226// int semop(int semid, struct sembuf *sops, size_t nsops);
185227
186228// semctl
229// int semctl(int semid, int semnum, int op, ...);
187230
188231// shmdt
232// int shmdt(const void *shmaddr);
189233
190234// msgget
235// int msgget(key_t key, int msgflg);
191236
192237// msgsnd
238// int msgsnd(int msqid, const void msgp[.msgsz], size_t msgsz, int msgflg);
193239
194240// msgrcv
241// ssize_t msgrcv(int msqid, void msgp[.msgsz], size_t msgsz, long msgtyp, int msgflg);
195242
196243// msgctl
244// int msgctl(int msqid, int op, struct msqid_ds *buf);
197245
198246// fcntl
247// int fcntl(int fd, int op, ... /* arg */ );
199248
200249// flock
250// int flock(int fd, int op);
201251
202252// fsync
253// int fsync(int fd);
203254
204255// fdatasync
256// int fdatasync(int fd);
205257
206258// truncate
259// int truncate(const char *path, off_t length);
207260
208261// ftruncate
262// int ftruncate(int fd, off_t length);
209263
210264// getdents
265// ssize_t getdents64(int fd, void dirp[.count], size_t count);
211266
212267// getcwd
268// char *getcwd(char buf[.size], size_t size);
213269
214270// chdir
271// int chdir(const char *path);
215272
216273// fchdir
274// int fchdir(int fd);
217275
218276// rename
277// int rename(const char *oldpath, const char *newpath);
219278
220279// mkdir
280// int mkdir(const char *pathname, mode_t mode);
221281
222282// rmdir
283// int rmdir(const char *pathname);
223284
224285// creat
286// int creat(const char *pathname, mode_t mode);
225287
226288// link
289// int link(const char *oldpath, const char *newpath);
227290
228291// unlink
292// int unlink(const char *pathname);
229293
230294// symlink
295// int symlink(const char *target, const char *linkpath);
231296
232297// readlink
298// ssize_t readlink(const char *restrict pathname, char *restrict buf, size_t bufsiz);
233299
234300// chmod
301// int chmod(const char *pathname, mode_t mode);
235302
236303// fchmod
304// int fchmod(int fd, mode_t mode);
237305
238306// chown
307// int chown(const char *pathname, uid_t owner, gid_t group);
239308
240309// fchown
310// int fchown(int fd, uid_t owner, gid_t group);
241311
242312// lchown
313// int lchown(const char *pathname, uid_t owner, gid_t group);
243314
244315// umask
316// mode_t umask(mode_t mask);
245317
246318// gettimeofday
319// int gettimeofday(struct timeval *restrict tv, struct timezone *_Nullable restrict tz);
247320
248321// getrlimit
322// int getrlimit(int resource, struct rlimit *rlim);
249323
250324// getrusage
325// int getrusage(int who, struct rusage *usage);
251326
252327// sysinfo
328// int sysinfo(struct sysinfo *info);
253329
254330// times
331// clock_t times(struct tms *buf);
255332
256333// ptrace
334// long ptrace(enum __ptrace_request op, pid_t pid, void *addr, void *data);
257335
258336// getuid
337// uid_t getuid(void);
259338
260339// syslog
340// int syscall(SYS_syslog, int type, char *bufp, int len);
261341
262342// getgid
343// gid_t getgid(void);
263344
264345// setuid
346// int setuid(uid_t uid);
265347
266348// setgid
349// int setgid(gid_t gid);
267350
268351// geteuid
352// uid_t geteuid(void);
269353
270354// getegid
355// gid_t getegid(void);
271356
272357// setpgid
358// int setpgid(pid_t pid, pid_t pgid);
273359
274360// getppid
361// pid_t getppid(void);
275362
276363// getpgrp
364// pid_t getpgrp(void);
277365
278366// setsid
367// pid_t setsid(void);
279368
280369// setreuid
370// int setreuid(uid_t ruid, uid_t euid);
281371
282372// setregid
373// int setregid(gid_t rgid, gid_t egid);
283374
284375// getgroups
376// int getgroups(int size, gid_t list[]);
285377
286378// setgroups
379// int setgroups(size_t size, const gid_t *_Nullable list);
287380
288381// setresuid
382// int setresuid(uid_t ruid, uid_t euid, uid_t suid);
289383
290384// getresuid
385// int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid);
291386
292387// setresgid
388// int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
293389
294390// getresgid
391// int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid);
295392
296393// getpgid
394// pid_t getpgid(pid_t pid);
297395
298396// setfsuid
397// [[deprecated]] int setfsuid(uid_t fsuid);
299398
300399// setfsgid
400// [[deprecated]] int setfsgid(gid_t fsgid);
301401
302402// getsid
403// pid_t getsid(pid_t pid);
303404
304405// capget
406// int syscall(SYS_capget, cap_user_header_t hdrp, cap_user_data_t datap);
305407
306408// capset
409// int syscall(SYS_capset, cap_user_header_t hdrp, const cap_user_data_t datap);
307410
308411// rt_sigpending
309412
......@@ -314,40 +417,57 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
314417// rt_sigsuspend
315418
316419// sigaltstack
420// int sigaltstack(const stack_t *_Nullable restrict ss, stack_t *_Nullable restrict old_ss);
317421
318422// utime
423// int utime(const char *filename, const struct utimbuf *_Nullable times);
319424
320425// mknod
426// int mknod(const char *pathname, mode_t mode, dev_t dev);
321427
322428// uselib
429// [[deprecated]] int uselib(const char *library);
323430
324431// personality
432// int personality(unsigned long persona);
325433
326434// ustat
435// [[deprecated]] int ustat(dev_t dev, struct ustat *ubuf);
327436
328437// statfs
438// int statfs(const char *path, struct statfs *buf);
329439
330440// fstatfs
441// int fstatfs(int fd, struct statfs *buf);
331442
332443// sysfs
333444
334445// getpriority
446// int getpriority(int which, id_t who);
335447
336448// setpriority
449// int setpriority(int which, id_t who, int prio);
337450
338451// sched_setparam
452// int sched_setparam(pid_t pid, const struct sched_param *param);
339453
340454// sched_getparam
455// int sched_getparam(pid_t pid, struct sched_param *param);
341456
342457// sched_setscheduler
458// int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param);
343459
344460// sched_getscheduler
461// int sched_getscheduler(pid_t pid);
345462
346463// sched_get_priority_max
464// int sched_get_priority_max(int policy);
347465
348466// sched_get_priority_min
467// int sched_get_priority_min(int policy);
349468
350469// sched_rr_get_interval
470// int sched_rr_get_interval(pid_t pid, struct timespec *tp);
351471
352472// mlock
353473
......@@ -372,6 +492,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
372492// adjtimex
373493
374494// setrlimit
495// int setrlimit(int resource, const struct rlimit *rlim);
375496
376497// chroot
377498
......@@ -380,6 +501,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
380501// acct
381502
382503// settimeofday
504// int settimeofday(const struct timeval *tv, const struct timezone *_Nullable tz);
383505
384506// mount
385507
......@@ -522,6 +644,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
522644// tgkill
523645
524646// utimes
647// int utimes(const char *filename, const struct timeval times[_Nullable 2]);
525648
526649// vserver
527650
......@@ -569,8 +692,10 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
569692// int openat(int dirfd, const char *pathname, int flags, ... /* mode_t mode */ );
570693
571694// mkdirat
695// int mkdirat(int dirfd, const char *pathname, mode_t mode);
572696
573697// mknodat
698// int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev);
574699
575700// fchownat
576701
......@@ -580,16 +705,22 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
580705// int fstatat(int dirfd, const char *restrict pathname, struct stat *restrict statbuf, int flags);
581706
582707// unlinkat
708// int unlinkat(int dirfd, const char *pathname, int flags);
583709
584710// renameat
711// int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath);
585712
586713// linkat
714// int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags);
587715
588716// symlinkat
717// int symlinkat(const char *target, int newdirfd, const char *linkpath);
589718
590719// readlinkat
720// ssize_t readlinkat(int dirfd, const char *restrict pathname, char *restrict buf, size_t bufsiz);
591721
592722// fchmodat
723// int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags);
593724
594725// faccessat
595726// 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 {
601732// int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *_Nullable tmo_p, const sigset_t *_Nullable sigmask);
602733
603734// unshare
735// int unshare(int flags);
604736
605737// set_robust_list
606738
......@@ -633,6 +765,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
633765// timerfd_gettime
634766
635767// accept4
768// int accept4(int sockfd, struct sockaddr *_Nullable restrict addr, socklen_t *_Nullable restrict addrlen, int flags);
636769
637770// signalfd4
638771
......@@ -641,6 +774,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
641774// epoll_create1
642775
643776// dup3
777// int dup3(int oldfd, int newfd, int flags);
644778
645779// pipe2
646780// int pipe2(int pipefd[2], int flags);
......@@ -664,6 +798,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
664798// fanotify_mark
665799
666800// prlimit64
801// int prlimit(pid_t pid, int resource, const struct rlimit *_Nullable new_limit, struct rlimit *_Nullable old_limit);
667802
668803// name_to_handle_at
669804
......@@ -692,6 +827,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize {
692827// sched_getattr
693828
694829// renameat2
830// int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags);
695831
696832// seccomp
697833