diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/nr_syscalls.sh | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/scripts/nr_syscalls.sh b/scripts/nr_syscalls.sh index 380d6f1..5110a9b 100755 --- a/scripts/nr_syscalls.sh +++ b/scripts/nr_syscalls.sh @@ -27,31 +27,31 @@ FOOTER_NUMBERS="}; #endif" -syscalls=( - "accept" - "bind" - "connect" - "getpeername" - "getsockname" - "getsockopt" - "listen" - "mount" - "openat" - "recvfrom" - "recvmmsg" - "recvmsg" - "sendmmsg" - "sendmsg" - "sendto" - "setsockopt" - "shutdown" - "socket" - "socketpair" -) +syscalls=" + accept + bind + connect + getpeername + getsockname + getsockopt + listen + mount + openat + recvfrom + recvmmsg + recvmsg + sendmmsg + sendmsg + sendto + setsockopt + shutdown + socket + socketpair +" printf '%s\n' "${HEADER_NUMBERS}" > "${OUT_NUMBERS}" # syscall_nr - Get syscall number from compiler, also note in numbers.h -__in="$(printf "#include <asm-generic/unistd.h>\n#include <sys/syscall.h>\n__NR_%s" ${syscalls[@]})" +__in="$(for c in ${syscalls}; do printf "#include <asm-generic/unistd.h>\n#include <sys/syscall.h>\n__NR_%s" $c; done)" __out="$(echo "${__in}" |cc -E -xc - -o - |sed -n '/\#.*$/!p'| sed '/^$/d')" awk -v AS="${syscalls[*]}" -v BS="${__out[*]}" \ |