syscalls_rust/syscalls/arch64.rs
1#![cfg(feature = "arch64")]
2
3use std::ffi::*;
4use crate::types::*;
5
6
7
8
9
10unsafe extern "system" {
11
12 /// read() attempts to read up to count bytes from file descriptor fd
13 /// into the buffer starting at buf.<br>
14 /// #### RETURN VALUE
15 /// On success, the number of bytes read is returned (zero indicates
16 /// end of file), and the file position is advanced by this number.
17 /// #### ERRORS
18 /// EAGAIN(35), EBADF(9), EFAULT(14), EINTR(4), EINVAL(22), EIO(5), EISDIR(21), etc.
19 /// #### Link
20 /// Read the docs
21 /// [here](https://man7.org/linux/man-pages/man2/read.2.html)
22 pub unsafe fn read(fd: c_uint, buf: *mut c_char, count: size_t) -> ssize_t;
23
24 /// write() writes up to count bytes from the buffer starting at buf
25 /// to the file referred to by the file descriptor fd.<br>
26 /// #### RETURN VALUE
27 /// On success, the number of bytes written is returned. On error, -1
28 /// is returned, and errno is set to indicate the error.
29 /// #### ERRORS
30 /// EAGAIN(35), EBADF(9), EDESTADDRREQ(39), EDQUOT(69), EFAULT(14), EFBIG(27),<br>
31 /// EINTR(4), EINVAL(22), EIO(5), ENOSPC(28), EPERM(1), EPIPE(32), etc.
32 /// #### Link
33 /// Read the docs
34 /// [here](https://man7.org/linux/man-pages/man2/write.2.html)
35 pub unsafe fn write(fd: c_uint, buf: *const c_char, count: size_t) -> ssize_t;
36
37 /// The open() system call opens the file specified by pathname. If
38 /// the specified file does not exist, it may optionally (if O_CREAT
39 /// is specified in flags) be created by open().<br>
40 /// #### RETURN VALUE
41 /// On success, the number of bytes read is returned (zero indicates
42 /// end of file), and the file position is advanced by this number.
43 /// #### ERRORS
44 /// EAGAIN(35), EBADF(9), EFAULT(14), EINTR(4), EINVAL(22), EIO(5), EISDIR(21), etc.
45 /// #### Link
46 /// Read the docs
47 /// [here](https://man7.org/linux/man-pages/man2/open.2.html)
48 pub unsafe fn open(filename: *const c_char, flags: c_int, mode: umode_t) -> c_long;
49
50
51 pub unsafe fn close(fd: c_uint) -> c_int;
52 pub unsafe fn newstat(filename: *const c_char, statbuf: *mut Stat) -> c_int;
53 pub unsafe fn newfstat(fd: c_uint, statbuf: *mut Stat) -> c_int;
54 pub unsafe fn newlstat(filename: *const c_char, statbuf: *mut Stat) -> c_int;
55 pub unsafe fn poll(ufds: *mut Pollfd, nfds: c_uint, timeout_msecs: c_int) -> c_int;
56 pub unsafe fn lseek(fd: c_uint, offset: off_t, whence: c_uint) -> off_t;
57 pub unsafe fn mmap(addr: c_ulong, len: c_ulong, prot: c_ulong, flags: c_ulong, fd: c_ulong, off: c_ulong) -> c_ulong;
58 pub unsafe fn mprotect(start: c_ulong, len: size_t, prot: c_ulong) -> c_int;
59 pub unsafe fn munmap(addr: c_ulong, len: size_t) -> c_int;
60 pub unsafe fn brk(brk: c_ulong) -> c_ulong;
61
62
63 // pub unsafe fn rt_sigaction (int sig, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize);
64 // pub unsafe fn rt_sigaction(sig: c_int, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) -> c_int;
65
66 // pub unsafe fn rt_sigprocmask (int how, sigset_t *nset, sigset_t *oset, size_t sigsetsize);
67 // pub unsafe fn rt_sigreturn (void);
68 // pub unsafe fn ioctl (unsigned int fd, unsigned int cmd, unsigned long arg);
69 // pub unsafe fn pread64 (unsigned int fd, char *buf, size_t count, loff_t pos);
70 // pub unsafe fn pwrite64 (unsigned int fd, const char *buf, size_t count, loff_t pos);
71 // pub unsafe fn readv (unsigned long fd, const struct iovec *vec, unsigned long vlen);
72 // pub unsafe fn writev (unsigned long fd, const struct iovec *vec, unsigned long vlen);
73 // pub unsafe fn access (const char *filename, int mode);
74 // pub unsafe fn pipe (int *fildes);
75 // pub unsafe fn select (int n, fd_set *inp, fd_set *outp, fd_set *exp, struct __kernel_old_timeval *tvp);
76 // pub unsafe fn sched_yield (void);
77 // pub unsafe fn mremap (unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr);
78 // pub unsafe fn msync (MMU unsigned long start, size_t len, int flags);
79 // pub unsafe fn mincore (MMU unsigned long start, size_t len, unsigned char *vec);
80 // pub unsafe fn madvise (ADVISE_SYSCALLS unsigned long start, size_t len_in, int behavior);
81 // pub unsafe fn shmget (SYSVIPC key_t key, size_t size, int shmflg);
82 // pub unsafe fn shmat (SYSVIPC int shmid, char *shmaddr, int shmflg
83 // pub unsafe fn shmct (SYSVIPC int shmid, int cmd, struct shmid_ds *buf);
84 // pub unsafe fn dup (unsigned int fildes);
85 // pub unsafe fn dup2 (unsigned int oldfd, unsigned int newfd);
86 // pub unsafe fn pause (void);
87 // pub unsafe fn nanosleep (struct __kernel_timespec *rqtp, struct __kernel_timespec *rmtp);
88 // pub unsafe fn getitimer (int which, struct __kernel_old_itimerval *value);
89 // pub unsafe fn alarm (unsigned int seconds
90 // pub unsafe fn setitimer (int which, struct __kernel_old_itimerval *value, struct __kernel_old_itimerval *ovalue);
91
92 // pub unsafe fn getpid (void);
93 pub unsafe fn getpid() -> pid_t;
94
95 // pub unsafe fn sendfile64 (int out_fd, int in_fd, loff_t *offset, size_t count);
96 pub unsafe fn socket(family: c_int, _type: c_int, protocol: c_int) -> c_int;
97 pub unsafe fn connect(fd: c_int,uservaddr: *mut sockaddr, addrlen: c_int) -> c_int;
98 pub unsafe fn accept(fd: c_int, upeer_sockaddr: *mut sockaddr, upeer_addrlen: *mut c_int) -> c_int;
99 // pub unsafe fn sendto (NET int fd, void *buff, size_t len, unsigned int flags, struct sockaddr *addr, int addr_len);
100 // pub unsafe fn recvfrom (NET int fd, void *ubuf, size_t size, unsigned int flags, struct sockaddr *addr, int *addr_len);
101 // pub unsafe fn sendmsg (NET int fd, struct user_msghdr *msg, unsigned int flags);
102 // pub unsafe fn recvmsg (NET int fd, struct user_msghdr *msg, unsigned int flags);
103 // pub unsafe fn shutdown (NET int fd, int how);
104 pub unsafe fn bind(fd: c_int, umyaddr: *mut sockaddr, addrlen: c_int) -> c_int;
105 pub unsafe fn listen(fd: c_int, backlog: c_int) -> c_int;
106 // pub unsafe fn getsockname (NET int fd, struct sockaddr *usockaddr, int *usockaddr_len);
107 // pub unsafe fn getpeername (NET int fd, struct sockaddr *usockaddr, int *usockaddr_len);
108 // pub unsafe fn socketpair (NET int family, int type, int protocol, int *usockvec);
109 // pub unsafe fn setsockopt (NET int fd, int level, int optname, char *optval, int optlen);
110 // pub unsafe fn getsockopt (NET int fd, int level, int optname, char *optval, int *optlen);
111 // pub unsafe fn clone (unsigned long clone_flags, unsigned long newsp, int *parent_tidptr, int *child_tidptr, unsigned long tls);
112 pub unsafe fn fork() -> pid_t;
113 pub unsafe fn vfork() -> pid_t;
114 pub unsafe fn execve(filename: *const c_char, argv: *const *const c_char, envp: *const *const c_char) -> c_int;
115 pub unsafe fn exit(error_code: c_int);
116 // pub unsafe fn wait4 (pid_t upid, int *stat_addr, int options, struct rusage *ru);
117 pub unsafe fn kill(pid: pid_t, sig: c_int) -> c_int;
118 // pub unsafe fn newuname ( struct new_utsname *name);
119 // pub unsafe fn semget (SYSVIPC key_t key, int nsems, int semflg);
120 // pub unsafe fn semop (SYSVIPC int semid, struct sembuf *tsops, unsigned nsops);
121 // pub unsafe fn semctl (SYSVIPC int semid, int semnum, int cmd, unsigned long arg);
122 // pub unsafe fn shmdt (SYSVIPC char *shmaddr);
123 // pub unsafe fn msgget (SYSVIPC key_t key, int msgflg);
124 // pub unsafe fn msgsnd (SYSVIPC int msqid, struct msgbuf *msgp, size_t msgsz, int msgflg);
125 // pub unsafe fn msgrcv (SYSVIPC int msqid, struct msgbuf *msgp, size_t msgsz, long msgtyp, int msgflg);
126 // pub unsafe fn msgctl (SYSVIPC int msqid, int cmd, struct msqid_ds *buf);
127 pub unsafe fn fcntl(fd: c_uint, cmd: c_uint, arg: c_uint) -> c_long;
128 pub unsafe fn flock(fd: c_uint, cmd: c_uint) -> c_int;
129 pub unsafe fn fsync(fd: c_uint) -> c_int;
130 pub unsafe fn fdatasync(fd: c_uint) -> c_int;
131 pub unsafe fn truncate(path: *const c_char, length: c_long) -> c_long;
132 pub unsafe fn ftruncate(fd: c_uint, length: off_t) -> c_long;
133 // pub unsafe fn getdents(unsigned int fd, struct linux_dirent *dirent, unsigned int count);
134 pub unsafe fn getcwd(buf: *mut c_char, size: c_ulong) -> c_int;
135 pub unsafe fn chdir(filename: *const c_char) -> c_int;
136 pub unsafe fn fchdir(fd: c_uint) -> c_int;
137 pub unsafe fn rename(oldname: *const c_char, newname: *const c_char) -> c_uint;
138 pub unsafe fn mkdir(pathname: *const c_char, mode: umode_t) -> c_int;
139 pub unsafe fn rmdir(pathname: *const c_char) -> c_int;
140 pub unsafe fn creat(pathname: *const c_char, mode: umode_t) -> c_long;
141 pub unsafe fn link(oldname: *const c_char, newname: *const c_char) -> c_int;
142 pub unsafe fn unlink(pathname: *const c_char) -> c_int;
143 pub unsafe fn symlink(oldname: *const c_char, newname: *const c_char) -> c_int;
144 pub unsafe fn readlink(path: *const c_char, buf: *mut c_char, bufsiz: c_int) -> c_int;
145 pub unsafe fn chmod(filename: *const c_char, mode: umode_t) -> c_int;
146 pub unsafe fn fchmod(fd: c_int, mode: umode_t) -> c_int;
147 pub unsafe fn chown(filename: *const c_char, user: uid_t, group: gid_t) -> c_int;
148 // pub unsafe fn fchown (unsigned int fd, uid_t user, gid_t group);
149 // pub unsafe fn lchown (const char *filename, uid_t user, gid_t group);
150 pub unsafe fn umask (mask: c_int) -> c_int;
151 // pub unsafe fn gettimeofday (struct __kernel_old_timeval *tv, struct timezone *tz);
152 // pub unsafe fn getrlimit (unsigned int resource, struct rlimit *rlim);
153 // pub unsafe fn getrusage (int who, struct rusage *ru);
154 // pub unsafe fn sysinfo (struct sysinfo *info);
155 // pub unsafe fn times (struct tms *tbuf);
156 // pub unsafe fn ptrace (long request, long pid, unsigned long addr, unsigned long data);
157 pub unsafe fn getuid() -> uid_t;
158 pub unsafe fn syslog(_type: c_int, buf: *mut c_char, len: c_int) -> c_int;
159 pub unsafe fn getgid() -> uid_t;
160 pub unsafe fn setuid(uid: uid_t) -> c_long;
161 pub unsafe fn setgid(gid: gid_t) -> c_long;
162 pub unsafe fn geteuid() -> uid_t;
163 pub unsafe fn getegid() -> uid_t;
164 pub unsafe fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
165 pub unsafe fn getppid() -> c_int;
166 pub unsafe fn getpgrp() -> c_int;
167 pub unsafe fn setsid() -> c_int;
168 // pub unsafe fn setreuid (MULTIUSER uid_t ruid, uid_t euid);
169 // pub unsafe fn setregid (MULTIUSER gid_t rgid, gid_t egid);
170 // pub unsafe fn getgroups (MULTIUSER int gidsetsize, gid_t *grouplist);
171 // pub unsafe fn setgroups (MULTIUSER int gidsetsize, gid_t *grouplist);
172 // pub unsafe fn setresuid (MULTIUSER uid_t ruid, uid_t euid, uid_t suid);
173 // pub unsafe fn getresuid (MULTIUSER uid_t *ruidp, uid_t *euidp, uid_t *suidp);
174 // pub unsafe fn setresgid (MULTIUSER gid_t rgid, gid_t egid, gid_t sgid);
175 // pub unsafe fn getresgid (MULTIUSER gid_t *rgidp, gid_t *egidp, gid_t *sgidp);
176 // pub unsafe fn getpgid (pid_t pid);
177 // pub unsafe fn setfsuid (MULTIUSER uid_t uid);
178 // pub unsafe fn setfsgid (MULTIUSER gid_t gid);
179 // pub unsafe fn getsid (pid_t pid);
180 // pub unsafe fn capget (MULTIUSER cap_user_header_t header, cap_user_data_t dataptr);
181 // pub unsafe fn capset (MULTIUSER cap_user_header_t header, const cap_user_data_t data);
182 // pub unsafe fn rt_sigpending (sigset_t *uset, size_t sigsetsize);
183 // pub unsafe fn rt_sigtimedwait (const sigset_t *uthese, siginfo_t *uinfo, const struct __kernel_timespec *uts, size_t sigsetsize);
184
185 // pub unsafe fn rt_sigsuspend (sigset_t *unewset, size_t sigsetsize);
186 // pub unsafe fn rt_sigqueueinfo (pid_t pid, int sig, siginfo_t *uinfo);
187 // pub unsafe fn sigaltstack (const stack_t *uss, stack_t *uoss);
188 // pub unsafe fn utime (char *filename, struct utimbuf *times);
189 // pub unsafe fn mknod (const char *filename, umode_t mode, unsigned dev);
190 // pub unsafe fn personality (unsigned int personality);
191 // pub unsafe fn ustat (unsigned dev, struct ustat *ubuf);
192 // pub unsafe fn statfs (const char *pathname, struct statfs *buf);
193 // pub unsafe fn fstatfs (unsigned int fd, struct statfs *buf);
194 // pub unsafe fn sysfs (SYSFS_SYSCALL int option, unsigned long arg1, unsigned long arg2);
195 // pub unsafe fn getpriority (int which, int who);
196 // pub unsafe fn setpriority (int which, int who, int niceval);
197 // pub unsafe fn sched_setparam (pid_t pid, struct sched_param *param);
198 // pub unsafe fn sched_getparam (pid_t pid, struct sched_param *param);
199 // pub unsafe fn sched_setscheduler (pid_t pid, int policy, struct sched_param *param);
200 // pub unsafe fn sched_getscheduler (pid_t pid);
201 // pub unsafe fn sched_get_priority_max (int policy);
202 // pub unsafe fn sched_get_priority_min (int policy);
203 // pub unsafe fn sched_rr_get_interval ( pid_t pid, struct __kernel_timespec *interval);
204 // pub unsafe fn mlock ( MMU unsigned long start, size_t len);
205 // pub unsafe fn munlock ( MMU unsigned long start, size_t len);
206 // pub unsafe fn mlockall ( MMU int flags);
207 // pub unsafe fn munlockall ( MMU void);
208 // pub unsafe fn vhangup ( void);
209 // pub unsafe fn modify_ldt ( MODIFY_LDT_SYSCALL int func, void *ptr, unsigned long bytecount);
210 // pub unsafe fn pivot_root ( const char *new_root, const char *put_old);
211 // pub unsafe fn prctl ( int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);
212 // pub unsafe fn arch_prctl ( int option, unsigned long arg2);
213 // pub unsafe fn adjtimex ( struct __kernel_timex *txc_p);
214 // pub unsafe fn setrlimit ( unsigned int resource, struct rlimit *rlim);
215 // pub unsafe fn chroot ( const char *filename);
216 // pub unsafe fn sync ( void);
217 // pub unsafe fn acct ( BSD_PROCESS_ACCT const char *name);
218 // pub unsafe fn settimeofday ( struct __kernel_old_timeval *tv, struct timezone *tz);
219 pub unsafe fn mount(dev_name: *mut c_char, dir_name: *mut c_char, _type: *mut c_char, flags: c_ulong, data: *mut c_void) -> c_int;
220 pub unsafe fn umount(name: *mut c_char, flags: c_int) -> c_int;
221 pub unsafe fn swapon(specialfile: *const c_char, swap_flags: c_int) -> c_int;
222 pub unsafe fn swapoff(specialfile: *const c_char);
223 // pub unsafe fn reboot ( int magic1, int magic2, unsigned int cmd, void *arg);
224 // pub unsafe fn sethostname (char *name, int len);
225 // pub unsafe fn setdomainname( char *name, int len);
226 // pub unsafe fn statmount ( const struct mnt_id_req *req, struct statmount *buf, size_t bufsize, unsigned int flags);
227 // pub unsafe fn listmount ( const struct mnt_id_req *req, u64 *mnt_ids, size_t nr_mnt_ids, unsigned int flags);
228 // pub unsafe fn lsm_get_self_attr ( SECURITY unsigned int attr, struct lsm_ctx *ctx, u32 *size, u32 flags);
229 // pub unsafe fn lsm_set_self_attr ( SECURITY unsigned int attr, struct lsm_ctx *ctx, u32 size, u32 flags);
230 // pub unsafe fn lsm_list_modules ( SECURITY u64 *ids, u32 *size, u32 flags);
231 // pub unsafe fn mseal ( unsigned long start, size_t len, unsigned long flags);
232 // pub unsafe fn setxattrat ( int dfd, const char *pathname, unsigned int at_flags, const char *name, const struct xattr_args *uargs, size_t usize);
233 // pub unsafe fn getxattrat ( int dfd, const char *pathname, unsigned int at_flags, const char *name, struct xattr_args *uargs, size_t usize);
234 // pub unsafe fn listxattrat ( int dfd, const char *pathname, unsigned int at_flags, char *list, size_t size);
235 // pub unsafe fn removexattrat ( int dfd, const char *pathname, unsigned int at_flags, const char *name);
236 // pub unsafe fn iopl ( X86_IOPL_IOPERM unsigned int level);
237 // pub unsafe fn ioperm ( X86_IOPL_IOPERM unsigned long from, unsigned long num, int turn_on);
238 // pub unsafe fn init_module ( MODULES void *umod, unsigned long len, const char *uargs);
239 // pub unsafe fn delete_module ( MODULE_UNLOAD const char *name_user, unsigned int flags);
240 // pub unsafe fn quotactl ( QUOTACTL unsigned int cmd, const char *special, qid_t id, void *addr);
241 // pub unsafe fn gettid ( void);
242 // pub unsafe fn readahead ( int fd, loff_t offset, size_t count);
243 // pub unsafe fn setxattr ( const char *pathname, const char *name, const void *value, size_t size, int flags);
244 // pub unsafe fn lsetxattr ( const char *pathname, const char *name, const void *value, size_t size, int flags);
245 // pub unsafe fn fsetxattr ( int fd, const char *name, const void *value, size_t size, int flags);
246 // pub unsafe fn getxattr ( const char *pathname, const char *name, void *value, size_t size);
247 // pub unsafe fn lgetxattr ( const char *pathname, const char *name, void *value, size_t size);
248 // pub unsafe fn fgetxattr ( int fd, const char *name, void *value, size_t size);
249 // pub unsafe fn listxattr ( const char *pathname, char *list, size_t size);
250 // pub unsafe fn llistxattr ( const char *pathname, char *list, size_t size);
251 // pub unsafe fn flistxattr ( int fd, char *list, size_t size);
252 // pub unsafe fn removexattr ( const char *pathname, const char *name);
253 // pub unsafe fn lremovexattr ( const char *pathname, const char *name);
254 // pub unsafe fn fremovexattr ( int fd, const char *name);
255 // pub unsafe fn tkill ( pid_t pid, int sig);
256 // pub unsafe fn time ( __kernel_old_time_t *tloc);
257 // pub unsafe fn futex ( FUTEX u32 *uaddr, int op, u32 val, const struct __kernel_timespec *utime, u32 *uaddr2, u32 val3);
258 // pub unsafe fn sched_setaffinity( pid_t pid, unsigned int len, unsigned long *user_mask_ptr);
259 // pub unsafe fn sched_getaffinity ( pid_t pid, unsigned int len, unsigned long *user_mask_ptr);
260 // pub unsafe fn io_setup ( AIO unsigned nr_events, aio_context_t *ctxp);
261 // pub unsafe fn io_destroy ( AIO aio_context_t ctx);
262 // pub unsafe fn io_getevents ( AIO aio_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct __kernel_timespec *timeout);
263 // pub unsafe fn io_submit ( AIO aio_context_t ctx_id, long nr, struct iocb **iocbpp);
264 // pub unsafe fn io_cancel ( AIO aio_context_t ctx_id, struct iocb *iocb, struct io_event *result);
265 // pub unsafe fn epoll_create ( EPOLL int size
266 // pub unsafe fn remap_file_pages ( MMU unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long flags);
267 // pub unsafe fn getdents64 ( unsigned int fd, struct linux_dirent64 *dirent, unsigned int count);
268 // pub unsafe fn set_tid_address ( int *tidptr);
269 // pub unsafe fn restart_syscall ( void);
270 // pub unsafe fn semtimedop ( SYSVIPC int semid, struct sembuf *tsops, unsigned int nsops, const struct __kernel_timespec *timeout);
271 // pub unsafe fn fadvise64 ( ADVISE_SYSCALLS int fd, loff_t offset, size_t len, int advice);
272 // pub unsafe fn timer_create ( const clockid_t which_clock, struct sigevent *timer_event_spec, timer_t *created_timer_id);
273 // pub unsafe fn timer_settime ( timer_t timer_id, int flags, const struct __kernel_itimerspec *new_setting, struct __kernel_itimerspec *old_setting);
274 // pub unsafe fn timer_gettime ( timer_t timer_id, struct __kernel_itimerspec *setting);
275 // pub unsafe fn timer_getoverrun ( timer_t timer_id);
276 // pub unsafe fn timer_delete ( timer_t timer_id);
277
278 // pub unsafe fn clock_settime ( const clockid_t which_clock, const struct __kernel_timespec *tp);
279 // pub unsafe fn clock_gettime( const clockid_t which_clock, struct __kernel_timespec *tp);
280 // pub unsafe fn clock_getres ( const clockid_t which_clock, struct __kernel_timespec *tp);
281 // pub unsafe fn clock_nanosleep ( const clockid_t which_clock, int flags, const struct __kernel_timespec *rqtp, struct __kernel_timespec *rmtp);
282 // pub unsafe fn exit_group ( int error_code);
283 // pub unsafe fn epoll_wait ( EPOLL int epfd, struct epoll_event *events, int maxevents, int timeout);
284 // pub unsafe fn epoll_ctl ( EPOLL int epfd, int op, int fd, struct epoll_event *event);
285 // pub unsafe fn tgkill ( pid_t tgid, pid_t pid, int sig);
286 // pub unsafe fn utimes ( char *filename, struct __kernel_old_timeval *utimes);
287 // pub unsafe fn mbind ( NUMA unsigned long start, unsigned long len, unsigned long mode, const unsigned long *nmask, unsigned long maxnode, unsigned int flags);
288 // pub unsafe fn set_mempolicy ( NUMA int mode, const unsigned long *nmask, unsigned long maxnode);
289 // pub unsafe fn get_mempolicy( NUMA int *policy, unsigned long *nmask, unsigned long maxnode, unsigned long addr, unsigned long flags);
290 // pub unsafe fn mq_open ( POSIX_MQUEUE const char *u_name, int oflag, umode_t mode, struct mq_attr *u_attr);
291 // pub unsafe fn mq_unlink ( POSIX_MQUEUE const char *u_name);
292 // pub unsafe fn mq_timedsend ( POSIX_MQUEUE mqd_t mqdes, const char *u_msg_ptr, size_t msg_len, unsigned int msg_prio, const struct __kernel_timespec *u_abs_timeout);
293 // pub unsafe fn mq_timedreceive ( POSIX_MQUEUE mqd_t mqdes, char *u_msg_ptr, size_t msg_len, unsigned int *u_msg_prio, const struct __kernel_timespec *u_abs_timeout);
294 // pub unsafe fn mq_notify ( POSIX_MQUEUE mqd_t mqdes, const struct sigevent *u_notification);
295 // pub unsafe fn mq_getsetattr ( POSIX_MQUEUE mqd_t mqdes, const struct mq_attr *u_mqstat, struct mq_attr *u_omqstat);
296 // pub unsafe fn kexec_load ( KEXEC unsigned long entry, unsigned long nr_segments, struct kexec_segment *segments, unsigned long flags);
297 // pub unsafe fn waitid ( int which, pid_t upid, struct siginfo *infop, int options, struct rusage *ru);
298 // pub unsafe fn add_key ( KEYS const char *_type, const char *_description, const void *_payload, size_t plen, key_serial_t ringid);
299 // pub unsafe fn request_key ( KEYS const char *_type, const char *_description, const char *_callout_info, key_serial_t destringid);
300 // pub unsafe fn keyctl ( KEYS int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5);
301 // pub unsafe fn ioprio_set ( BLOCK int which, int who, int ioprio);
302 // pub unsafe fn ioprio_get ( BLOCK int which, int who);
303 // pub unsafe fn inotify_init ( INOTIFY_USER void);
304 // pub unsafe fn inotify_add_watch ( INOTIFY_USER int fd, const char *pathname, u32 mask);
305 // pub unsafe fn inotify_rm_watch ( INOTIFY_USER int fd, __s32 wd);
306
307 // pub unsafe fn migrate_pages ( MIGRATION pid_t pid, unsigned long maxnode, const unsigned long *old_nodes, const unsigned long *new_nodes);
308 // pub unsafe fn openat ( int dfd, const char *filename, int flags, umode_t mode);
309 // pub unsafe fn mkdirat ( int dfd, const char *pathname, umode_t mode);
310 // pub unsafe fn mknodat ( int dfd, const char *filename, umode_t mode, unsigned int dev);
311 // pub unsafe fn fchownat ( int dfd, const char *filename, uid_t user, gid_t group, int flag);
312 // pub unsafe fn futimesat ( int dfd, const char *filename, struct __kernel_old_timeval *utimes);
313 // pub unsafe fn newfstatat ( int dfd, const char *filename, struct stat *statbuf, int flag);
314 // pub unsafe fn unlinkat ( int dfd, const char *pathname, int flag);
315 // pub unsafe fn renameat ( int olddfd, const char *oldname, int newdfd, const char *newname);
316 // pub unsafe fn linkat ( int olddfd, const char *oldname, int newdfd, const char *newname, int flags);
317 // pub unsafe fn symlinkat ( const char *oldname, int newdfd, const char *newname);
318 // pub unsafe fn readlinkat ( int dfd, const char *pathname, char *buf, int bufsiz);
319 // pub unsafe fn fchmodat ( int dfd, const char *filename, umode_t mode);
320 // pub unsafe fn faccessat ( int dfd, const char *filename, int mode);
321 // pub unsafe fn pselect6 ( int n, fd_set *inp, fd_set *outp, fd_set *exp, struct __kernel_timespec *tsp, void *sig);
322 // pub unsafe fn ppoll ( struct pollfd *ufds, unsigned int nfds, struct __kernel_timespec *tsp, const sigset_t *sigmask, size_t sigsetsize);
323 // pub unsafe fn unshare ( unsigned long unshare_flags);
324 // pub unsafe fn set_robust_list ( FUTEX struct robust_list_head *head, size_t len);
325 // pub unsafe fn get_robust_list ( FUTEX int pid, struct robust_list_head **head_ptr, size_t *len_ptr);
326 // pub unsafe fn splice ( int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags);
327 // pub unsafe fn tee ( int fdin, int fdout, size_t len, unsigned int flags);
328 // pub unsafe fn sync_file_range ( int fd, loff_t offset, loff_t nbytes, unsigned int flags);
329 // pub unsafe fn vmsplice ( int fd, const struct iovec *uiov, unsigned long nr_segs, unsigned int flags);
330 // pub unsafe fn move_pages ( MIGRATION pid_t pid, unsigned long nr_pages, const void **pages, const int *nodes, int *status, int flags);
331 // pub unsafe fn utimensat ( int dfd, const char *filename, struct __kernel_timespec *utimes, int flags);
332 // pub unsafe fn epoll_pwait ( EPOLL int epfd, struct epoll_event *events, int maxevents, int timeout, const sigset_t *sigmask, size_t sigsetsize);
333 // pub unsafe fn signalfd ( SIGNALFD int ufd, sigset_t *user_mask, size_t sizemask);
334 // pub unsafe fn timerfd_create ( int clockid, int flags);
335 // pub unsafe fn eventfd ( unsigned int count);
336 // pub unsafe fn fallocate ( int fd, int mode, loff_t offset, loff_t len);
337 // pub unsafe fn timerfd_settime ( int ufd, int flags, const struct __kernel_itimerspec *utmr, struct __kernel_itimerspec *otmr);
338 // pub unsafe fn timerfd_gettime ( int ufd, struct __kernel_itimerspec *otmr);
339 // pub unsafe fn accept4 ( NET int fd, struct sockaddr *upeer_sockaddr, int *upeer_addrlen, int flags);
340 // pub unsafe fn signalfd4 ( SIGNALFD int ufd, sigset_t *user_mask, size_t sizemask, int flags);
341 // pub unsafe fn eventfd2 ( unsigned int count, int flags);
342 // pub unsafe fn epoll_create1 ( EPOLL int flags);
343 // pub unsafe fn dup3 ( unsigned int oldfd, unsigned int newfd, int flags);
344 // pub unsafe fn pipe2 ( int *fildes, int flags);
345 // pub unsafe fn inotify_init1 ( INOTIFY_USER int flags);
346 // pub unsafe fn preadv ( unsigned long fd, const struct iovec *vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
347 // pub unsafe fn pwritev ( unsigned long fd, const struct iovec *vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h);
348 // pub unsafe fn rt_tgsigqueueinfo( pid_t tgid, pid_t pid, int sig, siginfo_t *uinfo);
349 // pub unsafe fn perf_event_open ( PERF_EVENTS struct perf_event_attr *attr_uptr, pid_t pid, int cpu, int group_fd, unsigned long flags);
350 // pub unsafe fn recvmmsg ( NET int fd, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags, struct __kernel_timespec *timeout);
351 // pub unsafe fn fanotify_init ( FANOTIFY unsigned int flags, unsigned int event_f_flags);
352 // pub unsafe fn fanotify_mark ( FANOTIFY int fanotify_fd, unsigned int flags, __u64 mask, int dfd, const char *pathname);
353 // pub unsafe fn prlimit64 ( pid_t pid, unsigned int resource, const struct rlimit64 *new_rlim, struct rlimit64 *old_rlim);
354 // pub unsafe fn name_to_handle_at ( FHANDLE int dfd, const char *name, struct file_handle *handle, void *mnt_id, int flag);
355 // pub unsafe fn open_by_handle_at ( FHANDLE int mountdirfd, struct file_handle *handle, int flags);
356 // pub unsafe fn clock_adjtime ( const clockid_t which_clock, struct __kernel_timex *utx);
357 // pub unsafe fn syncfs ( int fd);
358 // pub unsafe fn sendmmsg ( NET int fd, struct mmsghdr *mmsg, unsigned int vlen, unsigned int flags);
359 // pub unsafe fn setns ( int fd, int flags);
360 // pub unsafe fn getcpu ( unsigned *cpup, unsigned *nodep, struct getcpu_cache *unused);
361 // pub unsafe fn process_vm_readv ( CROSS_MEMORY_ATTACH pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags);
362 // pub unsafe fn process_vm_writev ( CROSS_MEMORY_ATTACH pid_t pid, const struct iovec *lvec, unsigned long liovcnt, const struct iovec *rvec, unsigned long riovcnt, unsigned long flags);
363 // pub unsafe fn kcmp ( KCMP pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2);
364 // pub unsafe fn finit_module ( MODULES int fd, const char *uargs, int flags);
365 // pub unsafe fn sched_setattr ( pid_t pid, struct sched_attr *uattr, unsigned int flags);
366 // pub unsafe fn sched_getattr ( pid_t pid, struct sched_attr *uattr, unsigned int usize, unsigned int flags);
367 // pub unsafe fn renameat2 ( int olddfd, const char *oldname, int newdfd, const char *newname, unsigned int flags);
368 // pub unsafe fn seccomp ( SECCOMP unsigned int op, unsigned int flags, void *uargs);
369 // pub unsafe fn getrandom ( char *ubuf, size_t len, unsigned int flags);
370 // pub unsafe fn memfd_create ( MEMFD_CREATE const char *uname, unsigned int flags);
371 // pub unsafe fn kexec_file_load ( KEXEC_FILE int kernel_fd, int initrd_fd, unsigned long cmdline_len, const char *cmdline_ptr, unsigned long flags);
372 // pub unsafe fn bpf ( BPF_SYSCALL int cmd, union bpf_attr *uattr, unsigned int size);
373 // pub unsafe fn execveat ( int fd, const char *filename, const char *const *argv, const char *const *envp, int flags);
374 // pub unsafe fn userfaultfd ( USERFAULTFD int flags);
375 // pub unsafe fn membarrier ( MEMBARRIER int cmd, unsigned int flags, int cpu_id);
376 // pub unsafe fn mlock2 ( MMU unsigned long start, size_t len, int flags);
377 // pub unsafe fn copy_file_range ( int fd_in, loff_t *off_in, int fd_out, loff_t *off_out, size_t len, unsigned int flags);
378 // pub unsafe fn preadv2 ( unsigned long fd, const struct iovec *vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h, rwf_t flags);
379 // pub unsafe fn pwritev2 ( unsigned long fd, const struct iovec *vec, unsigned long vlen, unsigned long pos_l, unsigned long pos_h, rwf_t flags);
380 // pub unsafe fn pkey_mprotect ( X86_INTEL_MEMORY_PROTECTION_KEYS unsigned long start, size_t len, unsigned long prot, int pkey);
381 // pub unsafe fn pkey_alloc ( X86_INTEL_MEMORY_PROTECTION_KEYS unsigned long flags, unsigned long init_val);
382 // pub unsafe fn pkey_free ( X86_INTEL_MEMORY_PROTECTION_KEYS int pkey);
383 // pub unsafe fn statx ( int dfd, const char *filename, unsigned flags, unsigned int mask, struct statx *buffer);
384 // pub unsafe fn io_pgetevents ( AIO aio_context_t ctx_id, long min_nr, long nr, struct io_event *events, struct __kernel_timespec *timeout, const struct __aio_sigset *usig);
385 // pub unsafe fn rseq ( RSEQ struct rseq *rseq, u32 rseq_len, int flags, u32 sig);
386 // pub unsafe fn uretprobe ( void);
387 // pub unsafe fn pidfd_send_signal ( int pidfd, int sig, siginfo_t *info, unsigned int flags);
388 // pub unsafe fn io_uring_setup ( IO_URING u32 entries, struct io_uring_params *params);
389 // pub unsafe fn io_uring_enter ( IO_URING unsigned int fd, u32 to_submit, u32 min_complete, u32 flags, const void *argp, size_t argsz);
390 // pub unsafe fn io_uring_register ( IO_URING unsigned int fd, unsigned int opcode, void *arg, unsigned int nr_args);
391 // pub unsafe fn open_tree ( int dfd, const char *filename, unsigned flags);
392 // pub unsafe fn move_mount ( int from_dfd, const char *from_pathname, int to_dfd, const char *to_pathname, unsigned int flags);
393 // pub unsafe fn fsopen ( const char *_fs_name, unsigned int flags);
394 // pub unsafe fn fsconfig( int fd, unsigned int cmd, const char *_key, const void *_value, int aux);
395 // pub unsafe fn fsmount ( int fs_fd, unsigned int flags, unsigned int attr_flags);
396 // pub unsafe fn fspick ( int dfd, const char *path, unsigned int flags);
397 // pub unsafe fn pidfd_open ( pid_t pid, unsigned int flags);
398 // pub unsafe fn clone3 ( struct clone_args *uargs, size_t size);
399 // pub unsafe fn close_range ( unsigned int fd, unsigned int max_fd, unsigned int flags);
400 // pub unsafe fn openat2 ( int dfd, const char *filename, struct open_how *how, size_t usize);
401 // pub unsafe fn pidfd_getfd ( int pidfd, int fd, unsigned int flags);
402 // pub unsafe fn faccessat2 ( int dfd, const char *filename, int mode, int flags);
403 // pub unsafe fn process_madvise ( ADVISE_SYSCALLS int pidfd, const struct iovec *vec, size_t vlen, int behavior, unsigned int flags);
404 // pub unsafe fn epoll_pwait2 ( EPOLL int epfd, struct epoll_event *events, int maxevents, const struct __kernel_timespec *timeout, const sigset_t *sigmask, size_t sigsetsize);
405 // pub unsafe fn mount_setattr ( int dfd, const char *path, unsigned int flags, struct mount_attr *uattr, size_t usize);
406 // pub unsafe fn quotactl_fd ( QUOTACTL unsigned int fd, unsigned int cmd, qid_t id, void *addr);
407 // pub unsafe fn landlock_create_ruleset ( SECURITY_LANDLOCK const struct landlock_ruleset_attr *const attr, const size_t size, const __u32 flags);
408 // pub unsafe fn landlock_add_rule ( SECURITY_LANDLOCK const int ruleset_fd, const enum landlock_rule_type rule_type, const void *const rule_attr, const __u32 flags);
409 // pub unsafe fn landlock_restrict_self ( SECURITY_LANDLOCK const int ruleset_fd, const __u32 flags);
410 // pub unsafe fn memfd_secret ( SECRETMEM unsigned int flags);
411 // pub unsafe fn process_mrelease ( MMU int pidfd, unsigned int flags);
412 // pub unsafe fn futex_waitv ( FUTEX struct futex_waitv *waiters, unsigned int nr_futexes, unsigned int flags, struct __kernel_timespec *timeout, clockid_t clockid);
413 // pub unsafe fn set_mempolicy_home_node ( NUMA unsigned long start, unsigned long len, unsigned long home_node, unsigned long flags);
414 // pub unsafe fn cachestat ( CACHESTAT_SYSCALL unsigned int fd, struct cachestat_range *cstat_range, struct cachestat *cstat, unsigned int flags);
415 // pub unsafe fn fchmodat2 ( int dfd, const char *filename, umode_t mode, unsigned int flags);
416 // pub unsafe fn map_shadow_stack ( X86_USER_SHADOW_STACK unsigned long addr, unsigned long size, unsigned int flags);
417 // pub unsafe fn futex_wake ( FUTEX void *uaddr, unsigned long mask, int nr, unsigned int flags);
418 // pub unsafe fn futex_wait ( FUTEX void *uaddr, unsigned long val, unsigned long mask, unsigned int flags, struct __kernel_timespec *timeout, clockid_t clockid);
419 // pub unsafe fn futex_requeue ( FUTEX struct futex_waitv *waiters, unsigned int flags, int nr_wake, int nr_requeue);
420}
421
422
423
424
425
426
427