#
# System calls table, please make sure the table consist only the syscalls
# really used somewhere in project.
# from kernel/linux-3.10.84/arch/mips/include/uapi/asm/unistd.h Linux 64-bit syscalls are in the range from 5000 to 5999.
#
# __NR_name			code		name			arguments
# -------------------------------------------------------------------------------------------------------------------------------------------------------------
__NR_read			5000		sys_read		(int fd, void *buf, unsigned long count)
__NR_write			5001		sys_write		(int fd, const void *buf, unsigned long count)
__NR_open			5002		sys_open		(const char *filename, unsigned long flags, unsigned long mode)
__NR_close			5003		sys_close		(int fd)
__NR_lseek			5008		sys_lseek		(int fd, unsigned long offset, unsigned long origin)
__NR_mmap			5009		sys_mmap		(void *addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long offset)
__NR_mprotect			5010		sys_mprotect		(const void *addr, unsigned long len, unsigned long prot)
__NR_munmap			5011		sys_munmap		(void *addr, unsigned long len)
__NR_brk			5012		sys_brk			(void *addr)
__NR_rt_sigaction		5013		sys_sigaction		(int signum, const rt_sigaction_t *act, rt_sigaction_t *oldact, size_t sigsetsize)
__NR_rt_sigprocmask		5014		sys_sigprocmask		(int how, k_rtsigset_t *set, k_rtsigset_t *old, size_t sigsetsize)
__NR_rt_sigreturn		5211		sys_rt_sigreturn	(void)
__NR_ioctl			5015		sys_ioctl		(unsigned int fd, unsigned int cmd, unsigned long arg)
__NR_pread64			5016		sys_pread		(unsigned int fd, char *buf, size_t count, loff_t pos)
__NR_mremap			5024		sys_mremap		(unsigned long addr, unsigned long old_len, unsigned long new_len, unsigned long flags, unsigned long new_addr)
__NR_mincore			5026		sys_mincore		(void *addr, unsigned long size, unsigned char *vec)
__NR_madvise			5027		sys_madvise		(unsigned long start, size_t len, int behavior)
__NR_shmat			5029		sys_shmat		(int shmid, void *shmaddr, int shmflag)
__NR_dup2			5032		sys_dup2		(int oldfd, int newfd)
__NR_nanosleep			5034		sys_nanosleep		(struct timespec *req, struct timespec *rem)
__NR_getitimer			5035		sys_getitimer		(int which, const struct itimerval *val)
__NR_setitimer			5036		sys_setitimer		(int which, const struct itimerval *val, struct itimerval *old)
__NR_getpid			5038		sys_getpid		(void)
__NR_socket			5040		sys_socket		(int domain, int type, int protocol)
__NR_connect			5041		sys_connect		(int sockfd, struct sockaddr *addr, int addrlen)
__NR_sendto			5043		sys_sendto		(int sockfd, void *buff, size_t len, unsigned int flags, struct sockaddr *addr, int addr_len)
__NR_recvfrom			5044		sys_recvfrom		(int sockfd, void *ubuf, size_t size, unsigned int flags, struct sockaddr *addr, int *addr_len)
__NR_sendmsg			5045		sys_sendmsg		(int sockfd, const struct msghdr *msg, int flags)
__NR_recvmsg			5046		sys_recvmsg		(int sockfd, struct msghdr *msg, int flags)
__NR_shutdown			5047		sys_shutdown		(int sockfd, int how)
__NR_bind			5048		sys_bind		(int sockfd, const struct sockaddr *addr, int addrlen)
__NR_setsockopt			5053		sys_setsockopt		(int sockfd, int level, int optname, const void *optval, socklen_t optlen)
__NR_getsockopt			5054		sys_getsockopt		(int sockfd, int level, int optname, const void *optval, socklen_t *optlen)
__NR_clone			5055		sys_clone		(unsigned long flags, void *child_stack, void *parent_tid, unsigned long newtls, void *child_tid)
__NR_exit			5058		sys_exit		(unsigned long error_code)
__NR_wait4			5059		sys_wait4		(int pid, int *status, int options, struct rusage *ru)
__NR_kill			5060		sys_kill		(long pid, int sig)
__NR_fcntl			5070		sys_fcntl		(int fd, int type, long arg)
__NR_flock			5071		sys_flock		(int fd, unsigned long cmd)
__NR_mkdir			5081		sys_mkdir		(const char *name, int mode)
__NR_rmdir			5082		sys_rmdir		(const char *name)
__NR_unlink			5085		sys_unlink		(char *pathname)
__NR_umask			5093		sys_umask		(int mask)
__NR_gettimeofday		5094		sys_gettimeofday	(struct timeval *tv, struct timezone *tz)
__NR_ptrace			5099		sys_ptrace		(long request, pid_t pid, void *addr, void *data)
__NR_getgroups			5113		sys_getgroups		(int gsize, unsigned int *groups)
__NR_setgroups			5114		sys_setgroups		(int gsize, unsigned int *groups)
__NR_setresuid			5115		sys_setresuid		(int uid, int euid, int suid)
__NR_getresuid			5116		sys_getresuid		(int *uid, int *euid, int *suid)
__NR_setresgid			5117		sys_setresgid		(int gid, int egid, int sgid)
__NR_getresgid			5118		sys_getresgid		(int *gid, int *egid, int *sgid)
__NR_getpgid			5119		sys_getpgid		(pid_t pid)
__NR_setfsuid			5120		sys_setfsuid		(int fsuid)
__NR_setfsgid			5121		sys_setfsgid		(int fsgid)
__NR_getsid			5122		sys_getsid		(void)
__NR_capget			5123		sys_capget		(struct cap_header *h, struct cap_data *d)
__NR_capset			5124		sys_capset		(struct cap_header *h, struct cap_data *d)
__NR_rt_sigqueueinfo		5127		sys_rt_sigqueueinfo	(pid_t pid, int sig, siginfo_t *info)
__NR_sigaltstack		5129		sys_sigaltstack		(const void *uss, void *uoss)
__NR_personality		5132		sys_personality		(unsigned int personality)
__NR_setpriority		5138		sys_setpriority		(int which, int who, int nice)
__NR_sched_setscheduler		5141		sys_sched_setscheduler	(int pid, int policy, struct sched_param *p)
__NR_prctl			5153		sys_prctl		(int option, unsigned long arg2, unsigned long arg3, unsigned long arg4, unsigned long arg5)
__NR_setrlimit			5155		sys_setrlimit		(int resource, struct krlimit *rlim)
__NR_mount			5160		sys_mount		(char *dev_nmae, char *dir_name, char *type, unsigned long flags, void *data)
__NR_umount2			5161		sys_umount2		(char *name, int flags)
__NR_gettid			5178		sys_gettid		(void)
__NR_futex			5194		sys_futex		(uint32_t *uaddr, int op, uint32_t val, struct timespec *utime, uint32_t *uaddr2, uint32_t val3)
__NR_cacheflush			5197		sys_cacheflush		(char *addr, int nbytes, int cache)
__NR_io_setup			5200		sys_io_setup		(unsigned nr_events, aio_context_t *ctx)
__NR_io_getevents		5202		sys_io_getevents	(aio_context_t ctx, long min_nr, long nr, struct io_event *evs, struct timespec *tmo)
__NR_io_submit			5203		sys_io_submit		(aio_context_t ctx, long nr, struct iocb **iocbpp)
__NR_set_tid_address		5212		sys_set_tid_address	(int *tid_addr)
__NR_restart_syscall		5213		sys_restart_syscall	(void)
__NR_sys_timer_create		5216		sys_timer_create	(clockid_t which_clock, struct sigevent *timer_event_spec, kernel_timer_t *created_timer_id)
__NR_sys_timer_settime		5217		sys_timer_settime	(kernel_timer_t timer_id, int flags, const struct itimerspec *new_setting, struct itimerspec *old_setting)
__NR_sys_timer_gettime		5218		sys_timer_gettime	(int timer_id, const struct itimerspec *setting)
__NR_sys_timer_getoverrun	5219		sys_timer_getoverrun	(int timer_id)
__NR_sys_timer_delete		5220		sys_timer_delete	(kernel_timer_t timer_id)
__NR_clock_gettime		5222		sys_clock_gettime	(const clockid_t which_clock, const struct timespec *tp)
__NR_exit_group			5205		sys_exit_group		(int error_code)
__NR_set_thread_area		5242		sys_set_thread_area	(unsigned long *addr)
__NR_openat			5247		sys_openat		(int dfd, const char *filename, int flags, int mode)
__NR_waitid			5237		sys_waitid		(int which, pid_t pid, struct siginfo *infop, int options, struct rusage *ru)
__NR_readlinkat			5257		sys_readlinkat		(int fd, const char *path, char *buf, int bufsize)
__NR_ppoll			5261		sys_ppoll		(struct pollfd *fds, unsigned int nfds, const struct timespec *tmo, const sigset_t *sigmask, size_t sigsetsize)
__NR_set_robust_list		5268		sys_set_robust_list	(struct robust_list_head *head, size_t len)
__NR_get_robust_list		5269		sys_get_robust_list	(int pid, struct robust_list_head **head_ptr, size_t *len_ptr)
__NR_fallocate			5279		sys_fallocate		(int fd, int mode, loff_t offset, loff_t len)
__NR_seccomp			5312		sys_seccomp		(unsigned int op, unsigned int flags, const char *uargs)
__NR_vmsplice			5266		sys_vmsplice		(int fd, const struct iovec *iov, unsigned long nr_segs, unsigned int flags)
__NR_timerfd_settime		5282		sys_timerfd_settime	(int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
__NR_signalfd4			5283		sys_signalfd		(int fd, k_rtsigset_t *mask, size_t sizemask, int flags)
__NR_preadv			5289		sys_preadv_raw		(int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h)
__NR_rt_tgsigqueueinfo		5291		sys_rt_tgsigqueueinfo	(pid_t tgid, pid_t pid, int sig, siginfo_t *info)
__NR_fanotify_init		5295		sys_fanotify_init	(unsigned int flags, unsigned int event_f_flags)
__NR_fanotify_mark		5296		sys_fanotify_mark	(int fanotify_fd, unsigned int flags, uint64_t mask, int dfd, const char *pathname)
__NR_open_by_handle_at		5299		sys_open_by_handle_at	(int mountdirfd, struct file_handle *handle, int flags)
__NR_setns			5303		sys_setns		(int fd, int nstype)
__NR_kcmp			5306		sys_kcmp		(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2)
__NR_memfd_create		5314		sys_memfd_create	(const char *name, unsigned int flags)
__NR_userfaultfd		5317		sys_userfaultfd		(int flags)

##TODO for kernel
__NR_open_tree			5428		sys_open_tree		(int dirfd, const char *pathname, unsigned int flags)
__NR_move_mount			5429		sys_move_mount		(int from_dfd, const char *from_pathname, int to_dfd, const char *to_pathname, int flags)
__NR_fsopen			5430		sys_fsopen		(char *fsname, unsigned int flags)
__NR_fsconfig			5431		sys_fsconfig		(int fd, unsigned int cmd, const char *key, const char *value, int aux)
__NR_fsmount			5432		sys_fsmount		(int fd, unsigned int flags, unsigned int attr_flags)
__NR_clone3			5435		sys_clone3		(struct clone_args *uargs, size_t size)
__NR_close_range		5436		sys_close_range		(unsigned int fd, unsigned int max_fd, unsigned int flags)
__NR_pidfd_open			5434		sys_pidfd_open		(pid_t pid, unsigned int flags)
__NR_openat2			5437		sys_openat2		(int dirfd, char *pathname, struct open_how *how, size_t size)
__NR_pidfd_getfd		5438		sys_pidfd_getfd		(int pidfd, int targetfd, unsigned int flags)
__NR_rseq		        5327		sys_rseq		(void *rseq, uint32_t rseq_len, int flags, uint32_t sig)
__NR_membarrier 		5318		sys_membarrier		(int cmd, unsigned int flags, int cpu_id)
