| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 |
|
| 13 | set -e
|
| 14 |
|
| 15 | reference_table="$(dirname $0)/../arch/x86/entry/syscalls/syscall_32.tbl"
|
| 16 |
|
| 17 | ignore_list() {
|
| 18 | cat << EOF
|
| 19 | #include <asm/types.h>
|
| 20 | #include <asm/unistd.h>
|
| 21 |
|
| 22 | /* *at */
|
| 23 | #define __IGNORE_open /* openat */
|
| 24 | #define __IGNORE_link /* linkat */
|
| 25 | #define __IGNORE_unlink /* unlinkat */
|
| 26 | #define __IGNORE_mknod /* mknodat */
|
| 27 | #define __IGNORE_chmod /* fchmodat */
|
| 28 | #define __IGNORE_chown /* fchownat */
|
| 29 | #define __IGNORE_mkdir /* mkdirat */
|
| 30 | #define __IGNORE_rmdir /* unlinkat */
|
| 31 | #define __IGNORE_lchown /* fchownat */
|
| 32 | #define __IGNORE_access /* faccessat */
|
| 33 | #define __IGNORE_rename /* renameat2 */
|
| 34 | #define __IGNORE_readlink /* readlinkat */
|
| 35 | #define __IGNORE_symlink /* symlinkat */
|
| 36 | #define __IGNORE_utimes /* futimesat */
|
| 37 | #define __IGNORE_stat /* fstatat */
|
| 38 | #define __IGNORE_lstat /* fstatat */
|
| 39 | #define __IGNORE_stat64 /* fstatat64 */
|
| 40 | #define __IGNORE_lstat64 /* fstatat64 */
|
| 41 |
|
| 42 | #ifndef __ARCH_WANT_SET_GET_RLIMIT
|
| 43 | #define __IGNORE_getrlimit /* getrlimit */
|
| 44 | #define __IGNORE_setrlimit /* setrlimit */
|
| 45 | #endif
|
| 46 |
|
| 47 | #ifndef __ARCH_WANT_MEMFD_SECRET
|
| 48 | #define __IGNORE_memfd_secret
|
| 49 | #endif
|
| 50 |
|
| 51 | /* Missing flags argument */
|
| 52 | #define __IGNORE_renameat /* renameat2 */
|
| 53 |
|
| 54 | /* CLOEXEC flag */
|
| 55 | #define __IGNORE_pipe /* pipe2 */
|
| 56 | #define __IGNORE_dup2 /* dup3 */
|
| 57 | #define __IGNORE_epoll_create /* epoll_create1 */
|
| 58 | #define __IGNORE_inotify_init /* inotify_init1 */
|
| 59 | #define __IGNORE_eventfd /* eventfd2 */
|
| 60 | #define __IGNORE_signalfd /* signalfd4 */
|
| 61 |
|
| 62 | /* MMU */
|
| 63 | #ifndef CONFIG_MMU
|
| 64 | #define __IGNORE_madvise
|
| 65 | #define __IGNORE_mbind
|
| 66 | #define __IGNORE_mincore
|
| 67 | #define __IGNORE_mlock
|
| 68 | #define __IGNORE_mlockall
|
| 69 | #define __IGNORE_munlock
|
| 70 | #define __IGNORE_munlockall
|
| 71 | #define __IGNORE_mprotect
|
| 72 | #define __IGNORE_msync
|
| 73 | #define __IGNORE_migrate_pages
|
| 74 | #define __IGNORE_move_pages
|
| 75 | #define __IGNORE_remap_file_pages
|
| 76 | #define __IGNORE_get_mempolicy
|
| 77 | #define __IGNORE_set_mempolicy
|
| 78 | #define __IGNORE_swapoff
|
| 79 | #define __IGNORE_swapon
|
| 80 | #endif
|
| 81 |
|
| 82 | /* System calls for 32-bit kernels only */
|
| 83 | #if BITS_PER_LONG == 64
|
| 84 | #define __IGNORE_sendfile64
|
| 85 | #define __IGNORE_ftruncate64
|
| 86 | #define __IGNORE_truncate64
|
| 87 | #define __IGNORE_stat64
|
| 88 | #define __IGNORE_lstat64
|
| 89 | #define __IGNORE_fcntl64
|
| 90 | #define __IGNORE_fadvise64_64
|
| 91 | #define __IGNORE_fstatfs64
|
| 92 | #define __IGNORE_statfs64
|
| 93 | #define __IGNORE_llseek
|
| 94 | #define __IGNORE_mmap2
|
| 95 | #define __IGNORE_clock_gettime64
|
| 96 | #define __IGNORE_clock_settime64
|
| 97 | #define __IGNORE_clock_adjtime64
|
| 98 | #define __IGNORE_clock_getres_time64
|
| 99 | #define __IGNORE_clock_nanosleep_time64
|
| 100 | #define __IGNORE_timer_gettime64
|
| 101 | #define __IGNORE_timer_settime64
|
| 102 | #define __IGNORE_timerfd_gettime64
|
| 103 | #define __IGNORE_timerfd_settime64
|
| 104 | #define __IGNORE_utimensat_time64
|
| 105 | #define __IGNORE_pselect6_time64
|
| 106 | #define __IGNORE_ppoll_time64
|
| 107 | #define __IGNORE_io_pgetevents_time64
|
| 108 | #define __IGNORE_recvmmsg_time64
|
| 109 | #define __IGNORE_mq_timedsend_time64
|
| 110 | #define __IGNORE_mq_timedreceive_time64
|
| 111 | #define __IGNORE_semtimedop_time64
|
| 112 | #define __IGNORE_rt_sigtimedwait_time64
|
| 113 | #define __IGNORE_futex_time64
|
| 114 | #define __IGNORE_sched_rr_get_interval_time64
|
| 115 | #else
|
| 116 | #define __IGNORE_sendfile
|
| 117 | #define __IGNORE_ftruncate
|
| 118 | #define __IGNORE_truncate
|
| 119 | #define __IGNORE_stat
|
| 120 | #define __IGNORE_lstat
|
| 121 | #define __IGNORE_fcntl
|
| 122 | #define __IGNORE_fadvise64
|
| 123 | #define __IGNORE_newfstatat
|
| 124 | #define __IGNORE_fstatfs
|
| 125 | #define __IGNORE_statfs
|
| 126 | #define __IGNORE_lseek
|
| 127 | #define __IGNORE_mmap
|
| 128 | #define __IGNORE_clock_gettime
|
| 129 | #define __IGNORE_clock_settime
|
| 130 | #define __IGNORE_clock_adjtime
|
| 131 | #define __IGNORE_clock_getres
|
| 132 | #define __IGNORE_clock_nanosleep
|
| 133 | #define __IGNORE_timer_gettime
|
| 134 | #define __IGNORE_timer_settime
|
| 135 | #define __IGNORE_timerfd_gettime
|
| 136 | #define __IGNORE_timerfd_settime
|
| 137 | #define __IGNORE_utimensat
|
| 138 | #define __IGNORE_pselect6
|
| 139 | #define __IGNORE_ppoll
|
| 140 | #define __IGNORE_io_pgetevents
|
| 141 | #define __IGNORE_recvmmsg
|
| 142 | #define __IGNORE_mq_timedsend
|
| 143 | #define __IGNORE_mq_timedreceive
|
| 144 | #define __IGNORE_semtimedop
|
| 145 | #define __IGNORE_rt_sigtimedwait
|
| 146 | #define __IGNORE_futex
|
| 147 | #define __IGNORE_sched_rr_get_interval
|
| 148 | #define __IGNORE_gettimeofday
|
| 149 | #define __IGNORE_settimeofday
|
| 150 | #define __IGNORE_wait4
|
| 151 | #define __IGNORE_adjtimex
|
| 152 | #define __IGNORE_nanosleep
|
| 153 | #define __IGNORE_io_getevents
|
| 154 | #define __IGNORE_recvmmsg
|
| 155 | #endif
|
| 156 |
|
| 157 | /* i386-specific or historical system calls */
|
| 158 | #define __IGNORE_break
|
| 159 | #define __IGNORE_stty
|
| 160 | #define __IGNORE_gtty
|
| 161 | #define __IGNORE_ftime
|
| 162 | #define __IGNORE_prof
|
| 163 | #define __IGNORE_lock
|
| 164 | #define __IGNORE_mpx
|
| 165 | #define __IGNORE_ulimit
|
| 166 | #define __IGNORE_profil
|
| 167 | #define __IGNORE_ioperm
|
| 168 | #define __IGNORE_iopl
|
| 169 | #define __IGNORE_idle
|
| 170 | #define __IGNORE_modify_ldt
|
| 171 | #define __IGNORE_ugetrlimit
|
| 172 | #define __IGNORE_vm86
|
| 173 | #define __IGNORE_vm86old
|
| 174 | #define __IGNORE_set_thread_area
|
| 175 | #define __IGNORE_get_thread_area
|
| 176 | #define __IGNORE_madvise1
|
| 177 | #define __IGNORE_oldstat
|
| 178 | #define __IGNORE_oldfstat
|
| 179 | #define __IGNORE_oldlstat
|
| 180 | #define __IGNORE_oldolduname
|
| 181 | #define __IGNORE_olduname
|
| 182 | #define __IGNORE_umount
|
| 183 | #define __IGNORE_waitpid
|
| 184 | #define __IGNORE_stime
|
| 185 | #define __IGNORE_nice
|
| 186 | #define __IGNORE_signal
|
| 187 | #define __IGNORE_sigaction
|
| 188 | #define __IGNORE_sgetmask
|
| 189 | #define __IGNORE_sigsuspend
|
| 190 | #define __IGNORE_sigpending
|
| 191 | #define __IGNORE_ssetmask
|
| 192 | #define __IGNORE_readdir
|
| 193 | #define __IGNORE_socketcall
|
| 194 | #define __IGNORE_ipc
|
| 195 | #define __IGNORE_sigreturn
|
| 196 | #define __IGNORE_sigprocmask
|
| 197 | #define __IGNORE_bdflush
|
| 198 | #define __IGNORE__llseek
|
| 199 | #define __IGNORE__newselect
|
| 200 | #define __IGNORE_create_module
|
| 201 | #define __IGNORE_query_module
|
| 202 | #define __IGNORE_get_kernel_syms
|
| 203 | #define __IGNORE_sysfs
|
| 204 | #define __IGNORE_uselib
|
| 205 | #define __IGNORE__sysctl
|
| 206 | #define __IGNORE_arch_prctl
|
| 207 | #define __IGNORE_nfsservctl
|
| 208 |
|
| 209 | /* ... including the "new" 32-bit uid syscalls */
|
| 210 | #define __IGNORE_lchown32
|
| 211 | #define __IGNORE_getuid32
|
| 212 | #define __IGNORE_getgid32
|
| 213 | #define __IGNORE_geteuid32
|
| 214 | #define __IGNORE_getegid32
|
| 215 | #define __IGNORE_setreuid32
|
| 216 | #define __IGNORE_setregid32
|
| 217 | #define __IGNORE_getgroups32
|
| 218 | #define __IGNORE_setgroups32
|
| 219 | #define __IGNORE_fchown32
|
| 220 | #define __IGNORE_setresuid32
|
| 221 | #define __IGNORE_getresuid32
|
| 222 | #define __IGNORE_setresgid32
|
| 223 | #define __IGNORE_getresgid32
|
| 224 | #define __IGNORE_chown32
|
| 225 | #define __IGNORE_setuid32
|
| 226 | #define __IGNORE_setgid32
|
| 227 | #define __IGNORE_setfsuid32
|
| 228 | #define __IGNORE_setfsgid32
|
| 229 |
|
| 230 | /* these can be expressed using other calls */
|
| 231 | #define __IGNORE_alarm /* setitimer */
|
| 232 | #define __IGNORE_creat /* open */
|
| 233 | #define __IGNORE_fork /* clone */
|
| 234 | #define __IGNORE_futimesat /* utimensat */
|
| 235 | #define __IGNORE_getpgrp /* getpgid */
|
| 236 | #define __IGNORE_getdents /* getdents64 */
|
| 237 | #define __IGNORE_pause /* sigsuspend */
|
| 238 | #define __IGNORE_poll /* ppoll */
|
| 239 | #define __IGNORE_select /* pselect6 */
|
| 240 | #define __IGNORE_epoll_wait /* epoll_pwait */
|
| 241 | #define __IGNORE_time /* gettimeofday */
|
| 242 | #define __IGNORE_uname /* newuname */
|
| 243 | #define __IGNORE_ustat /* statfs */
|
| 244 | #define __IGNORE_utime /* utimes */
|
| 245 | #define __IGNORE_vfork /* clone */
|
| 246 |
|
| 247 | /* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */
|
| 248 | #ifdef __NR_sync_file_range2
|
| 249 | #define __IGNORE_sync_file_range
|
| 250 | #endif
|
| 251 |
|
| 252 | /* Unmerged syscalls for AFS, STREAMS, etc. */
|
| 253 | #define __IGNORE_afs_syscall
|
| 254 | #define __IGNORE_getpmsg
|
| 255 | #define __IGNORE_putpmsg
|
| 256 | #define __IGNORE_vserver
|
| 257 |
|
| 258 | /* 64-bit ports never needed these, and new 32-bit ports can use statx */
|
| 259 | #define __IGNORE_fstat64
|
| 260 | #define __IGNORE_fstatat64
|
| 261 |
|
| 262 | /* Newer ports are not required to provide fstat in favor of statx */
|
| 263 | #define __IGNORE_fstat
|
| 264 | EOF
|
| 265 | }
|
| 266 |
|
| 267 | syscall_list() {
|
| 268 | grep '^[0-9]' "$1" | sort -n |
|
| 269 | while read nr abi name entry ; do
|
| 270 | echo "#if !defined(__NR_${name}) && !defined(__IGNORE_${name})"
|
| 271 | echo "#warning syscall ${name} not implemented"
|
| 272 | echo "#endif"
|
| 273 | done
|
| 274 | }
|
| 275 |
|
| 276 | (ignore_list && syscall_list ${reference_table}) | \
|
| 277 | $* -Wno-error -Wno-unused-macros -E -x c - > /dev/null
|
| 278 |
|
| 279 | |
| 280 | if [ -n "${DEPFILE}" ]; then
|
| 281 | echo "${0}: ${0} ${reference_table}" >> "${DEPFILE}"
|
| 282 | fi
|