diff --git a/mod.zig b/mod.zig index ca47db4cb829e219adf1e35e1599bed8ef1ad4de..6c6308d3935b7d1aba9a13d249d0d6bb68f11148 100644 --- a/mod.zig +++ b/mod.zig @@ -100,210 +100,313 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // int select(int nfds, fd_set *_Nullable restrict readfds, fd_set *_Nullable restrict writefds, fd_set *_Nullable restrict exceptfds, struct timeval *_Nullable restrict timeout); // sched_yield +// int sched_yield(void); // mremap +// void *mremap(void old_address[.old_size], size_t old_size, size_t new_size, int flags, ... /* void *new_address */); // msync +// int msync(void addr[.length], size_t length, int flags); // mincore +// int mincore(void addr[.length], size_t length, unsigned char *vec); // madvise +// int madvise(void addr[.length], size_t length, int advice); // shmget +// int shmget(key_t key, size_t size, int shmflg); // shmat +// void *shmat(int shmid, const void *_Nullable shmaddr, int shmflg); // shmctl +// int shmctl(int shmid, int op, struct shmid_ds *buf); // dup +// int dup(int oldfd); // dup2 +// int dup2(int oldfd, int newfd); // pause +// int pause(void); // nanosleep +// int nanosleep(const struct timespec *duration, struct timespec *_Nullable rem); // getitimer +// int getitimer(int which, struct itimerval *curr_value); // alarm +// unsigned int alarm(unsigned int seconds); // setitimer +// int setitimer(int which, const struct itimerval *restrict new_value, struct itimerval *_Nullable restrict old_value); // getpid +// pid_t getpid(void); // sendfile +// ssize_t sendfile(int out_fd, int in_fd, off_t *_Nullable offset, size_t count); // socket +// int socket(int domain, int type, int protocol); // connect +// int connect(int sockfd, const struct sockaddr *addr, socklen_t addrlen); // accept +// int accept(int sockfd, struct sockaddr *_Nullable restrict addr, socklen_t *_Nullable restrict addrlen); // sendto +// ssize_t sendto(int sockfd, const void buf[.len], size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen); // recvfrom +// 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); // sendmsg +// ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags); // recvmsg +// ssize_t recvmsg(int sockfd, struct msghdr *msg, int flags); // shutdown +// int shutdown(int sockfd, int how); // bind +// int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); // listen +// int listen(int sockfd, int backlog); // getsockname +// int getsockname(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen); // getpeername +// int getpeername(int sockfd, struct sockaddr *restrict addr, socklen_t *restrict addrlen); // socketpair +// int socketpair(int domain, int type, int protocol, int sv[2]); // setsockopt +// int setsockopt(int sockfd, int level, int optname, const void optval[.optlen], socklen_t optlen); // getsockopt +// int getsockopt(int sockfd, int level, int optname, void optval[restrict *.optlen], socklen_t *restrict optlen); // clone +// 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 */ ); // fork +// pid_t fork(void); // vfork +// pid_t vfork(void); // execve +// int execve(const char *pathname, char *const _Nullable argv[], char *const _Nullable envp[]); // exit +// [[noreturn]] void _exit(int status); // wait4 +// pid_t wait4(pid_t pid, int *_Nullable wstatus, int options, struct rusage *_Nullable rusage); // kill +// int kill(pid_t pid, int sig); // uname +// int uname(struct utsname *buf); // semget +// int semget(key_t key, int nsems, int semflg); // semop +// int semop(int semid, struct sembuf *sops, size_t nsops); // semctl +// int semctl(int semid, int semnum, int op, ...); // shmdt +// int shmdt(const void *shmaddr); // msgget +// int msgget(key_t key, int msgflg); // msgsnd +// int msgsnd(int msqid, const void msgp[.msgsz], size_t msgsz, int msgflg); // msgrcv +// ssize_t msgrcv(int msqid, void msgp[.msgsz], size_t msgsz, long msgtyp, int msgflg); // msgctl +// int msgctl(int msqid, int op, struct msqid_ds *buf); // fcntl +// int fcntl(int fd, int op, ... /* arg */ ); // flock +// int flock(int fd, int op); // fsync +// int fsync(int fd); // fdatasync +// int fdatasync(int fd); // truncate +// int truncate(const char *path, off_t length); // ftruncate +// int ftruncate(int fd, off_t length); // getdents +// ssize_t getdents64(int fd, void dirp[.count], size_t count); // getcwd +// char *getcwd(char buf[.size], size_t size); // chdir +// int chdir(const char *path); // fchdir +// int fchdir(int fd); // rename +// int rename(const char *oldpath, const char *newpath); // mkdir +// int mkdir(const char *pathname, mode_t mode); // rmdir +// int rmdir(const char *pathname); // creat +// int creat(const char *pathname, mode_t mode); // link +// int link(const char *oldpath, const char *newpath); // unlink +// int unlink(const char *pathname); // symlink +// int symlink(const char *target, const char *linkpath); // readlink +// ssize_t readlink(const char *restrict pathname, char *restrict buf, size_t bufsiz); // chmod +// int chmod(const char *pathname, mode_t mode); // fchmod +// int fchmod(int fd, mode_t mode); // chown +// int chown(const char *pathname, uid_t owner, gid_t group); // fchown +// int fchown(int fd, uid_t owner, gid_t group); // lchown +// int lchown(const char *pathname, uid_t owner, gid_t group); // umask +// mode_t umask(mode_t mask); // gettimeofday +// int gettimeofday(struct timeval *restrict tv, struct timezone *_Nullable restrict tz); // getrlimit +// int getrlimit(int resource, struct rlimit *rlim); // getrusage +// int getrusage(int who, struct rusage *usage); // sysinfo +// int sysinfo(struct sysinfo *info); // times +// clock_t times(struct tms *buf); // ptrace +// long ptrace(enum __ptrace_request op, pid_t pid, void *addr, void *data); // getuid +// uid_t getuid(void); // syslog +// int syscall(SYS_syslog, int type, char *bufp, int len); // getgid +// gid_t getgid(void); // setuid +// int setuid(uid_t uid); // setgid +// int setgid(gid_t gid); // geteuid +// uid_t geteuid(void); // getegid +// gid_t getegid(void); // setpgid +// int setpgid(pid_t pid, pid_t pgid); // getppid +// pid_t getppid(void); // getpgrp +// pid_t getpgrp(void); // setsid +// pid_t setsid(void); // setreuid +// int setreuid(uid_t ruid, uid_t euid); // setregid +// int setregid(gid_t rgid, gid_t egid); // getgroups +// int getgroups(int size, gid_t list[]); // setgroups +// int setgroups(size_t size, const gid_t *_Nullable list); // setresuid +// int setresuid(uid_t ruid, uid_t euid, uid_t suid); // getresuid +// int getresuid(uid_t *ruid, uid_t *euid, uid_t *suid); // setresgid +// int setresgid(gid_t rgid, gid_t egid, gid_t sgid); // getresgid +// int getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid); // getpgid +// pid_t getpgid(pid_t pid); // setfsuid +// [[deprecated]] int setfsuid(uid_t fsuid); // setfsgid +// [[deprecated]] int setfsgid(gid_t fsgid); // getsid +// pid_t getsid(pid_t pid); // capget +// int syscall(SYS_capget, cap_user_header_t hdrp, cap_user_data_t datap); // capset +// int syscall(SYS_capset, cap_user_header_t hdrp, const cap_user_data_t datap); // rt_sigpending @@ -314,40 +417,57 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // rt_sigsuspend // sigaltstack +// int sigaltstack(const stack_t *_Nullable restrict ss, stack_t *_Nullable restrict old_ss); // utime +// int utime(const char *filename, const struct utimbuf *_Nullable times); // mknod +// int mknod(const char *pathname, mode_t mode, dev_t dev); // uselib +// [[deprecated]] int uselib(const char *library); // personality +// int personality(unsigned long persona); // ustat +// [[deprecated]] int ustat(dev_t dev, struct ustat *ubuf); // statfs +// int statfs(const char *path, struct statfs *buf); // fstatfs +// int fstatfs(int fd, struct statfs *buf); // sysfs // getpriority +// int getpriority(int which, id_t who); // setpriority +// int setpriority(int which, id_t who, int prio); // sched_setparam +// int sched_setparam(pid_t pid, const struct sched_param *param); // sched_getparam +// int sched_getparam(pid_t pid, struct sched_param *param); // sched_setscheduler +// int sched_setscheduler(pid_t pid, int policy, const struct sched_param *param); // sched_getscheduler +// int sched_getscheduler(pid_t pid); // sched_get_priority_max +// int sched_get_priority_max(int policy); // sched_get_priority_min +// int sched_get_priority_min(int policy); // sched_rr_get_interval +// int sched_rr_get_interval(pid_t pid, struct timespec *tp); // mlock @@ -372,6 +492,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // adjtimex // setrlimit +// int setrlimit(int resource, const struct rlimit *rlim); // chroot @@ -380,6 +501,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // acct // settimeofday +// int settimeofday(const struct timeval *tv, const struct timezone *_Nullable tz); // mount @@ -522,6 +644,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // tgkill // utimes +// int utimes(const char *filename, const struct timeval times[_Nullable 2]); // vserver @@ -569,8 +692,10 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // int openat(int dirfd, const char *pathname, int flags, ... /* mode_t mode */ ); // mkdirat +// int mkdirat(int dirfd, const char *pathname, mode_t mode); // mknodat +// int mknodat(int dirfd, const char *pathname, mode_t mode, dev_t dev); // fchownat @@ -580,16 +705,22 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // int fstatat(int dirfd, const char *restrict pathname, struct stat *restrict statbuf, int flags); // unlinkat +// int unlinkat(int dirfd, const char *pathname, int flags); // renameat +// int renameat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath); // linkat +// int linkat(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, int flags); // symlinkat +// int symlinkat(const char *target, int newdirfd, const char *linkpath); // readlinkat +// ssize_t readlinkat(int dirfd, const char *restrict pathname, char *restrict buf, size_t bufsiz); // fchmodat +// int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags); // faccessat // 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 { // int ppoll(struct pollfd *fds, nfds_t nfds, const struct timespec *_Nullable tmo_p, const sigset_t *_Nullable sigmask); // unshare +// int unshare(int flags); // set_robust_list @@ -633,6 +765,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // timerfd_gettime // accept4 +// int accept4(int sockfd, struct sockaddr *_Nullable restrict addr, socklen_t *_Nullable restrict addrlen, int flags); // signalfd4 @@ -641,6 +774,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // epoll_create1 // dup3 +// int dup3(int oldfd, int newfd, int flags); // pipe2 // int pipe2(int pipefd[2], int flags); @@ -664,6 +798,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // fanotify_mark // prlimit64 +// int prlimit(pid_t pid, int resource, const struct rlimit *_Nullable new_limit, struct rlimit *_Nullable old_limit); // name_to_handle_at @@ -692,6 +827,7 @@ pub fn write(fd: c_int, buf: []const u8) errno.Error!usize { // sched_getattr // renameat2 +// int renameat2(int olddirfd, const char *oldpath, int newdirfd, const char *newpath, unsigned int flags); // seccomp