1 #!/bin/sed -nf 2 3 # should not have been exported at all 4 /#define[[:space:]]\+__NR_\(sys_epoll_\|arch_specific_syscall\|syscalls\|syscall_count\|syscall_max\|available\|reserved\|unused\)/d 5 6 # should not be named this way 7 s/__NR_\(arm\|xtensa\)_fadvise64_64/__NR_fadvise64_64/ 8 9 # legacy names 10 s/__NR_get_cpu/__NR_getcpu/ 11 s/__NR_madvise1/__NR_madvise/ 12 s/__NR_paccept/__NR_accept4/ 13 14 # generate 15 s/#define[[:space:]]\+__NR_\([a-z_][^[:space:]]\+\)\([[:space:]].*\)\?$/#ifdef __NR_\1\n[__NR_\1 \& 0xffff] = "\1",\n#endif/p 16