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