linux/scripts/checksyscalls.sh
<<
val12 val12>> v val val12 "> val12 val12Search val12Prefs. 12 v v "> al12 2.
2 21#!/bin/sh 2 22# 2 23# Check if current architecture are missing any func v calls compared 2 24# to i386. 2 25# i386 define a number of legacy system calls that are i386 specific 2 26# and listed below so they are ignored. 2 27# 2 28# Usage: 2 29# checksyscalls.sh gcc gcc- > vs 2 " a># 2 11 2 12ignore_list() { 2 13cat << EOF 2 14#include <asm/typ s.h> 2 15#include <asm/unistd.h> 2 16 2 17/* *at */ 2 18#define __IGNORE_open /* openat */ 2 19#define __IGNORE_link /* linkat */ 2 20#define __IGNORE_unlink /* unlinkat */ 2 21#define __IGNORE_mknod /* mknodat */ 2 22#define __IGNORE_chmod /* fchmodat */ 2 23#define __IGNORE_chown /* fchownat */ 2 24#define __IGNORE_mkdir /* mkdirat */ 2 25#define __IGNORE_rmdir /* unlinkat */ 2 26#define __IGNORE_lchown /* fchownat */ 2 27#define __IGNORE_access /* faccessat */ 2 28#define __IGNORE_renam /* renam at */ 2 29#define __IGNORE_readlink /* readlinkat */ 2 30#define __IGNORE_symlink /* symlinkat */ 2 31#define __IGNORE_utimes /* futimesat */ 2 32#if BITS_PER_LONG == 64 2 33#define __IGNORE_stat /* fstatat */ 2 34#define __IGNORE_lstat /* fstatat */ 2 35#else 2 36#define __IGNORE_stat64 /* fstatat64 */ 2 37#define __IGNORE_lstat64 /* fstatat64 */ 2 38#endif 2 39 2 40/* CLOEXEC flag */ 2 41#define __IGNORE_pipe /* pipe2 */ 2 42#define __IGNORE_dup2 /* dup3 */ 2 43#define __IGNORE_epoll_create /* epoll_create1 */ 2 44#define __IGNORE_inotify_init /* inotify_init1 */ 2 45#define __IGNORE_eventfd /* eventfd2 */ 2 46#define __IGNORE_signalfd /* signalfd4 */ 2 47 2 48/* MMU */ 2 49#ifndef CONFIG_MMU 2 50#define __IGNORE_madvise 2 51#define __IGNORE_mbind 2 52#define __IGNORE_mincore 2 53#define __IGNORE_mlock 2 54#define __IGNORE_mlockall 2 55#define __IGNORE_munlock 2 56#define __IGNORE_munlockall 2 57#define __IGNORE_mprotect 2 58#define __IGNORE_msync 2 59#define __IGNORE_migrate_pages 2 60#define __IGNORE_move_pages 2 61#define __IGNORE_remap_file_pages 2 62#define __IGNORE_get_mempolicy 2 63#define __IGNORE_set_mempolicy 2 64#define __IGNORE_swapoff 2 65#define __IGNORE_swapon 2 66#endif 2 67 2 68/* System calls for 32-bit kernels only */ 2 69#if BITS_PER_LONG == 64 2 70#define __IGNORE_sendfile64 2 71#define __IGNORE_ftruncate64 2 72#define __IGNORE_truncate64 2 73#define __IGNORE_stat64 2 74#define __IGNORE_lstat64 2 75#define __IGNORE_fstat64 2 76#define __IGNORE_fcntl64 2 77#define __IGNORE_fadvise64_64 2 78#define __IGNORE_fstatat64 2 79#define __IGNORE_fstatfs64 2 80#define __IGNORE_statfs64 2 81#define __IGNORE_llseek 2 82#define __IGNORE_mmap2 2 83#else 2 84#define __IGNORE_sendfile 2 85#define __IGNORE_ftruncate 2 86#define __IGNORE_truncate 2 87#define __IGNORE_stat 2 88#define __IGNORE_lstat 2 89#define __IGNORE_fstat 2 90#define __IGNORE_fcntl 2 91#define __IGNORE_fadvise64 2 92#define __IGNORE_newfstatat 2 93#define __IGNORE_fstatfs 2 94#define __IGNORE_statfs 2 95#define __IGNORE_lseek 2 96#define __IGNORE_mmap 2 97#endif 2 98 2 99/* i386-specific or historical system calls */ 2100#define __IGNORE_break 2101#define __IGNORE_stty 2102#define __IGNORE_gtty 2103#define __IGNORE_ftime 2104#define __IGNORE_prof 2105#define __IGNORE_lock 2106#define __IGNORE_mpx 2107#define __IGNORE_ulimit 2108#define __IGNORE_profil 2109#define __IGNORE_ioperm 2110#define __IGNORE_iopl 2111#define __IGNORE_idle 2112#define __IGNORE_modify_ldt 2113#define __IGNORE_ugetrlimit 2114#define __IGNORE_vm86 2115#define __IGNORE_vm86old 2116#define __IGNORE_set_thread_area 2117#define __IGNORE_get_thread_area 2118#define __IGNORE_madvise1 2119#define __IGNORE_oldstat 2120#define __IGNORE_oldfstat 2121#define __IGNORE_oldlstat 2122#define __IGNORE_oldoldunam 2123#define __IGNORE_oldunam 2124#define __IGNORE_umount 2125#define __IGNORE_waitpid 2126#define __IGNORE_stime 2127#define __IGNORE_nice 2128#define __IGNORE_signal 2129#define __IGNORE_sigac v 2130#define __IGNORE_sgetmask 2131#define __IGNORE_sigsuspend 2132#define __IGNORE_sigpending 2133#define __IGNORE_ssetmask 2134#define __IGNORE_readdir 2135#define __IGNORE_socketcall 2136#define __IGNORE_ipc 2137#define __IGNORE_sigreturn 2138#define __IGNORE_sigprocmask 2139#define __IGNORE_bdflush 2140#define __IGNORE__llseek 2141#define __IGNORE__newselect 2142#define __IGNORE_create_module 2143#define __IGNORE_query_module 2144#define __IGNORE_get_kernel_syms 2145#define __IGNORE_sysfs 2146#define __IGNORE_uselib 2147#define __IGNORE__sysctl 2148 2149/* ... including the "new" 32-bit uid syscalls */ 2150#define __IGNORE_lchown32 2151#define __IGNORE_getuid32 2152#define __IGNORE_getgid32 2153#define __IGNORE_geteuid32 2154#define __IGNORE_getegid32 2155#define __IGNORE_setreuid32 2156#define __IGNORE_setregid32 2157#define __IGNORE_getgroups32 2158#define __IGNORE_setgroups32 2159#define __IGNORE_fchown32 2160#define __IGNORE_setresuid32 2161#define __IGNORE_getresuid32 2162#define __IGNORE_setresgid32 2163#define __IGNORE_getresgid32 2164#define __IGNORE_chown32 2165#define __IGNORE_setuid32 2166#define __IGNORE_setgid32 2167#define __IGNORE_setfsuid32 2168#define __IGNORE_setfsgid32 2169 2170/* these can be expressed using other calls */ 2171#define __IGNORE_alarm /* setitimer */ 2172#define __IGNORE_creat /* open */ 2173#define __IGNORE_fork /* clone */ 2174#define __IGNORE_futimesat /* utimensat */ 2175#define __IGNORE_getpgrp /* getpgid */ 2176#define __IGNORE_getdents /* getdents64 */ 2177#define __IGNORE_pause /* sigsuspend */ 2178#define __IGNORE_poll /* ppoll */ 2179#define __IGNORE_select /* pselect6 */ 2180#define __IGNORE_epoll_wait /* epoll_pwait */ 2181#define __IGNORE_time /* gettimeofday */ 2182#define __IGNORE_unam /* newunam */ 2183#define __IGNORE_ustat /* statfs */ 2184#define __IGNORE_utime /* utimes */ 2185#define __IGNORE_vfork /* clone */ 2186 2187/* sync_file_range had a stupid ABI. Allow sync_file_range2 instead */ 2188#ifdef __NR_sync_file_range2 2189#define __IGNORE_sync_file_range 2190#endif 2191 2192/* Unmerged syscalls for AFS, STREAMS, etc. */ 2193#define __IGNORE_afs_syscall 2194#define __IGNORE_getpmsg 2195#define __IGNORE_putpmsg 2196#define __IGNORE_vserver 2197EOF 2198} 2199 2200syscall_list() { 2201 grep '^[0-9]' "$1" | sort -n | ( 2202 while read nr abi nam entry ; do 2203 cat <<EOF 2204#if !defined(__NR_${nam }) && !defined(__IGNORE_${nam }) 2205#warning syscall ${nam } not implemented 2206#endif 2207EOF 2208 done 2209 ) 2210} 2211 2212(ignore_list && syscall_list $(dirnam $0)/../arch/x86/syscalls/syscall_32.tbl) | \ 2213$* -E -x c - > /dev/null 2214 The original LXR software by the LXR community, this experimental vers v by lxr@linux.no. lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and opera vs services since21995.