123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- #ifndef __ASMSH_SYSCALLS_H
- #define __ASMSH_SYSCALLS_H
-
- #include <sys/syscall.h>
-
- typedef struct {
- const char *name;
- const unsigned int nr;
- } syscall_info_t;
-
- /*
- Generated with
- sed -E 's/^#define __NR_([^ ]*) .*$/\1, __NR_\1/' /usr/include/asm/unistd_64.h |\
- grep -Ev '^$|^#' |\
- tr "\n" ";" |\
- sed -e 's/^/{{"/' -e 's/$/}}\n/' -e 's/,/",/g' -e 's/;/},\n{"/g' -e 's/{"}//'
- Result might be :
- Copyright (C) 1995-2020 Free Software Foundation, Inc.
- From a file that is part of the GNU C Library.
- */
-
- const static syscall_info_t syscall_infos[] = {
- {"read", __NR_read},
- {"write", __NR_write},
- {"open", __NR_open},
- {"close", __NR_close},
- {"stat", __NR_stat},
- {"fstat", __NR_fstat},
- {"lstat", __NR_lstat},
- {"poll", __NR_poll},
- {"lseek", __NR_lseek},
- {"mmap", __NR_mmap},
- {"mprotect", __NR_mprotect},
- {"munmap", __NR_munmap},
- {"brk", __NR_brk},
- {"rt_sigaction", __NR_rt_sigaction},
- {"rt_sigprocmask", __NR_rt_sigprocmask},
- {"rt_sigreturn", __NR_rt_sigreturn},
- {"ioctl", __NR_ioctl},
- {"pread64", __NR_pread64},
- {"pwrite64", __NR_pwrite64},
- {"readv", __NR_readv},
- {"writev", __NR_writev},
- {"access", __NR_access},
- {"pipe", __NR_pipe},
- {"select", __NR_select},
- {"sched_yield", __NR_sched_yield},
- {"mremap", __NR_mremap},
- {"msync", __NR_msync},
- {"mincore", __NR_mincore},
- {"madvise", __NR_madvise},
- {"shmget", __NR_shmget},
- {"shmat", __NR_shmat},
- {"shmctl", __NR_shmctl},
- {"dup", __NR_dup},
- {"dup2", __NR_dup2},
- {"pause", __NR_pause},
- {"nanosleep", __NR_nanosleep},
- {"getitimer", __NR_getitimer},
- {"alarm", __NR_alarm},
- {"setitimer", __NR_setitimer},
- {"getpid", __NR_getpid},
- {"sendfile", __NR_sendfile},
- {"socket", __NR_socket},
- {"connect", __NR_connect},
- {"accept", __NR_accept},
- {"sendto", __NR_sendto},
- {"recvfrom", __NR_recvfrom},
- {"sendmsg", __NR_sendmsg},
- {"recvmsg", __NR_recvmsg},
- {"shutdown", __NR_shutdown},
- {"bind", __NR_bind},
- {"listen", __NR_listen},
- {"getsockname", __NR_getsockname},
- {"getpeername", __NR_getpeername},
- {"socketpair", __NR_socketpair},
- {"setsockopt", __NR_setsockopt},
- {"getsockopt", __NR_getsockopt},
- {"clone", __NR_clone},
- {"fork", __NR_fork},
- {"vfork", __NR_vfork},
- {"execve", __NR_execve},
- {"exit", __NR_exit},
- {"wait4", __NR_wait4},
- {"kill", __NR_kill},
- {"uname", __NR_uname},
- {"semget", __NR_semget},
- {"semop", __NR_semop},
- {"semctl", __NR_semctl},
- {"shmdt", __NR_shmdt},
- {"msgget", __NR_msgget},
- {"msgsnd", __NR_msgsnd},
- {"msgrcv", __NR_msgrcv},
- {"msgctl", __NR_msgctl},
- {"fcntl", __NR_fcntl},
- {"flock", __NR_flock},
- {"fsync", __NR_fsync},
- {"fdatasync", __NR_fdatasync},
- {"truncate", __NR_truncate},
- {"ftruncate", __NR_ftruncate},
- {"getdents", __NR_getdents},
- {"getcwd", __NR_getcwd},
- {"chdir", __NR_chdir},
- {"fchdir", __NR_fchdir},
- {"rename", __NR_rename},
- {"mkdir", __NR_mkdir},
- {"rmdir", __NR_rmdir},
- {"creat", __NR_creat},
- {"link", __NR_link},
- {"unlink", __NR_unlink},
- {"symlink", __NR_symlink},
- {"readlink", __NR_readlink},
- {"chmod", __NR_chmod},
- {"fchmod", __NR_fchmod},
- {"chown", __NR_chown},
- {"fchown", __NR_fchown},
- {"lchown", __NR_lchown},
- {"umask", __NR_umask},
- {"gettimeofday", __NR_gettimeofday},
- {"getrlimit", __NR_getrlimit},
- {"getrusage", __NR_getrusage},
- {"sysinfo", __NR_sysinfo},
- {"times", __NR_times},
- {"ptrace", __NR_ptrace},
- {"getuid", __NR_getuid},
- {"syslog", __NR_syslog},
- {"getgid", __NR_getgid},
- {"setuid", __NR_setuid},
- {"setgid", __NR_setgid},
- {"geteuid", __NR_geteuid},
- {"getegid", __NR_getegid},
- {"setpgid", __NR_setpgid},
- {"getppid", __NR_getppid},
- {"getpgrp", __NR_getpgrp},
- {"setsid", __NR_setsid},
- {"setreuid", __NR_setreuid},
- {"setregid", __NR_setregid},
- {"getgroups", __NR_getgroups},
- {"setgroups", __NR_setgroups},
- {"setresuid", __NR_setresuid},
- {"getresuid", __NR_getresuid},
- {"setresgid", __NR_setresgid},
- {"getresgid", __NR_getresgid},
- {"getpgid", __NR_getpgid},
- {"setfsuid", __NR_setfsuid},
- {"setfsgid", __NR_setfsgid},
- {"getsid", __NR_getsid},
- {"capget", __NR_capget},
- {"capset", __NR_capset},
- {"rt_sigpending", __NR_rt_sigpending},
- {"rt_sigtimedwait", __NR_rt_sigtimedwait},
- {"rt_sigqueueinfo", __NR_rt_sigqueueinfo},
- {"rt_sigsuspend", __NR_rt_sigsuspend},
- {"sigaltstack", __NR_sigaltstack},
- {"utime", __NR_utime},
- {"mknod", __NR_mknod},
- {"uselib", __NR_uselib},
- {"personality", __NR_personality},
- {"ustat", __NR_ustat},
- {"statfs", __NR_statfs},
- {"fstatfs", __NR_fstatfs},
- {"sysfs", __NR_sysfs},
- {"getpriority", __NR_getpriority},
- {"setpriority", __NR_setpriority},
- {"sched_setparam", __NR_sched_setparam},
- {"sched_getparam", __NR_sched_getparam},
- {"sched_setscheduler", __NR_sched_setscheduler},
- {"sched_getscheduler", __NR_sched_getscheduler},
- {"sched_get_priority_max", __NR_sched_get_priority_max},
- {"sched_get_priority_min", __NR_sched_get_priority_min},
- {"sched_rr_get_interval", __NR_sched_rr_get_interval},
- {"mlock", __NR_mlock},
- {"munlock", __NR_munlock},
- {"mlockall", __NR_mlockall},
- {"munlockall", __NR_munlockall},
- {"vhangup", __NR_vhangup},
- {"modify_ldt", __NR_modify_ldt},
- {"pivot_root", __NR_pivot_root},
- {"_sysctl", __NR__sysctl},
- {"prctl", __NR_prctl},
- {"arch_prctl", __NR_arch_prctl},
- {"adjtimex", __NR_adjtimex},
- {"setrlimit", __NR_setrlimit},
- {"chroot", __NR_chroot},
- {"sync", __NR_sync},
- {"acct", __NR_acct},
- {"settimeofday", __NR_settimeofday},
- {"mount", __NR_mount},
- {"umount2", __NR_umount2},
- {"swapon", __NR_swapon},
- {"swapoff", __NR_swapoff},
- {"reboot", __NR_reboot},
- {"sethostname", __NR_sethostname},
- {"setdomainname", __NR_setdomainname},
- {"iopl", __NR_iopl},
- {"ioperm", __NR_ioperm},
- {"create_module", __NR_create_module},
- {"init_module", __NR_init_module},
- {"delete_module", __NR_delete_module},
- {"get_kernel_syms", __NR_get_kernel_syms},
- {"query_module", __NR_query_module},
- {"quotactl", __NR_quotactl},
- {"nfsservctl", __NR_nfsservctl},
- {"getpmsg", __NR_getpmsg},
- {"putpmsg", __NR_putpmsg},
- {"afs_syscall", __NR_afs_syscall},
- {"tuxcall", __NR_tuxcall},
- {"security", __NR_security},
- {"gettid", __NR_gettid},
- {"readahead", __NR_readahead},
- {"setxattr", __NR_setxattr},
- {"lsetxattr", __NR_lsetxattr},
- {"fsetxattr", __NR_fsetxattr},
- {"getxattr", __NR_getxattr},
- {"lgetxattr", __NR_lgetxattr},
- {"fgetxattr", __NR_fgetxattr},
- {"listxattr", __NR_listxattr},
- {"llistxattr", __NR_llistxattr},
- {"flistxattr", __NR_flistxattr},
- {"removexattr", __NR_removexattr},
- {"lremovexattr", __NR_lremovexattr},
- {"fremovexattr", __NR_fremovexattr},
- {"tkill", __NR_tkill},
- {"time", __NR_time},
- {"futex", __NR_futex},
- {"sched_setaffinity", __NR_sched_setaffinity},
- {"sched_getaffinity", __NR_sched_getaffinity},
- {"set_thread_area", __NR_set_thread_area},
- {"io_setup", __NR_io_setup},
- {"io_destroy", __NR_io_destroy},
- {"io_getevents", __NR_io_getevents},
- {"io_submit", __NR_io_submit},
- {"io_cancel", __NR_io_cancel},
- {"get_thread_area", __NR_get_thread_area},
- {"lookup_dcookie", __NR_lookup_dcookie},
- {"epoll_create", __NR_epoll_create},
- {"epoll_ctl_old", __NR_epoll_ctl_old},
- {"epoll_wait_old", __NR_epoll_wait_old},
- {"remap_file_pages", __NR_remap_file_pages},
- {"getdents64", __NR_getdents64},
- {"set_tid_address", __NR_set_tid_address},
- {"restart_syscall", __NR_restart_syscall},
- {"semtimedop", __NR_semtimedop},
- {"fadvise64", __NR_fadvise64},
- {"timer_create", __NR_timer_create},
- {"timer_settime", __NR_timer_settime},
- {"timer_gettime", __NR_timer_gettime},
- {"timer_getoverrun", __NR_timer_getoverrun},
- {"timer_delete", __NR_timer_delete},
- {"clock_settime", __NR_clock_settime},
- {"clock_gettime", __NR_clock_gettime},
- {"clock_getres", __NR_clock_getres},
- {"clock_nanosleep", __NR_clock_nanosleep},
- {"exit_group", __NR_exit_group},
- {"epoll_wait", __NR_epoll_wait},
- {"epoll_ctl", __NR_epoll_ctl},
- {"tgkill", __NR_tgkill},
- {"utimes", __NR_utimes},
- {"vserver", __NR_vserver},
- {"mbind", __NR_mbind},
- {"set_mempolicy", __NR_set_mempolicy},
- {"get_mempolicy", __NR_get_mempolicy},
- {"mq_open", __NR_mq_open},
- {"mq_unlink", __NR_mq_unlink},
- {"mq_timedsend", __NR_mq_timedsend},
- {"mq_timedreceive", __NR_mq_timedreceive},
- {"mq_notify", __NR_mq_notify},
- {"mq_getsetattr", __NR_mq_getsetattr},
- {"kexec_load", __NR_kexec_load},
- {"waitid", __NR_waitid},
- {"add_key", __NR_add_key},
- {"request_key", __NR_request_key},
- {"keyctl", __NR_keyctl},
- {"ioprio_set", __NR_ioprio_set},
- {"ioprio_get", __NR_ioprio_get},
- {"inotify_init", __NR_inotify_init},
- {"inotify_add_watch", __NR_inotify_add_watch},
- {"inotify_rm_watch", __NR_inotify_rm_watch},
- {"migrate_pages", __NR_migrate_pages},
- {"openat", __NR_openat},
- {"mkdirat", __NR_mkdirat},
- {"mknodat", __NR_mknodat},
- {"fchownat", __NR_fchownat},
- {"futimesat", __NR_futimesat},
- {"newfstatat", __NR_newfstatat},
- {"unlinkat", __NR_unlinkat},
- {"renameat", __NR_renameat},
- {"linkat", __NR_linkat},
- {"symlinkat", __NR_symlinkat},
- {"readlinkat", __NR_readlinkat},
- {"fchmodat", __NR_fchmodat},
- {"faccessat", __NR_faccessat},
- {"pselect6", __NR_pselect6},
- {"ppoll", __NR_ppoll},
- {"unshare", __NR_unshare},
- {"set_robust_list", __NR_set_robust_list},
- {"get_robust_list", __NR_get_robust_list},
- {"splice", __NR_splice},
- {"tee", __NR_tee},
- {"sync_file_range", __NR_sync_file_range},
- {"vmsplice", __NR_vmsplice},
- {"move_pages", __NR_move_pages},
- {"utimensat", __NR_utimensat},
- {"epoll_pwait", __NR_epoll_pwait},
- {"signalfd", __NR_signalfd},
- {"timerfd_create", __NR_timerfd_create},
- {"eventfd", __NR_eventfd},
- {"fallocate", __NR_fallocate},
- {"timerfd_settime", __NR_timerfd_settime},
- {"timerfd_gettime", __NR_timerfd_gettime},
- {"accept4", __NR_accept4},
- {"signalfd4", __NR_signalfd4},
- {"eventfd2", __NR_eventfd2},
- {"epoll_create1", __NR_epoll_create1},
- {"dup3", __NR_dup3},
- {"pipe2", __NR_pipe2},
- {"inotify_init1", __NR_inotify_init1},
- {"preadv", __NR_preadv},
- {"pwritev", __NR_pwritev},
- {"rt_tgsigqueueinfo", __NR_rt_tgsigqueueinfo},
- {"perf_event_open", __NR_perf_event_open},
- {"recvmmsg", __NR_recvmmsg},
- {"fanotify_init", __NR_fanotify_init},
- {"fanotify_mark", __NR_fanotify_mark},
- {"prlimit64", __NR_prlimit64},
- {"name_to_handle_at", __NR_name_to_handle_at},
- {"open_by_handle_at", __NR_open_by_handle_at},
- {"clock_adjtime", __NR_clock_adjtime},
- {"syncfs", __NR_syncfs},
- {"sendmmsg", __NR_sendmmsg},
- {"setns", __NR_setns},
- {"getcpu", __NR_getcpu},
- {"process_vm_readv", __NR_process_vm_readv},
- {"process_vm_writev", __NR_process_vm_writev},
- {"kcmp", __NR_kcmp},
- {"finit_module", __NR_finit_module},
- {"sched_setattr", __NR_sched_setattr},
- {"sched_getattr", __NR_sched_getattr},
- {"renameat2", __NR_renameat2},
- {"seccomp", __NR_seccomp},
- {"getrandom", __NR_getrandom},
- {"memfd_create", __NR_memfd_create},
- {"kexec_file_load", __NR_kexec_file_load},
- {"bpf", __NR_bpf},
- {"execveat", __NR_execveat},
- {"userfaultfd", __NR_userfaultfd},
- {"membarrier", __NR_membarrier},
- {"mlock2", __NR_mlock2},
- {"copy_file_range", __NR_copy_file_range},
- {"preadv2", __NR_preadv2},
- {"pwritev2", __NR_pwritev2},
- {"pkey_mprotect", __NR_pkey_mprotect},
- {"pkey_alloc", __NR_pkey_alloc},
- {"pkey_free", __NR_pkey_free},
- {"statx", __NR_statx},
- {"io_pgetevents", __NR_io_pgetevents},
- {"rseq", __NR_rseq},
- {"pidfd_send_signal", __NR_pidfd_send_signal},
- {"io_uring_setup", __NR_io_uring_setup},
- {"io_uring_enter", __NR_io_uring_enter},
- {"io_uring_register", __NR_io_uring_register},
- {"open_tree", __NR_open_tree},
- {"move_mount", __NR_move_mount},
- {"fsopen", __NR_fsopen},
- {"fsconfig", __NR_fsconfig},
- {"fsmount", __NR_fsmount},
- {"fspick", __NR_fspick},
- {"pidfd_open", __NR_pidfd_open},
- {"clone3", __NR_clone3},
- {"close_range", __NR_close_range},
- {"openat2", __NR_openat2},
- {"pidfd_getfd", __NR_pidfd_getfd},
- {"faccessat2", __NR_faccessat2},
- {"process_madvise", __NR_process_madvise},
- };
-
- #endif
|