From 601f7ee78ece7d54a12cf9191d23a3ec516d8948 Mon Sep 17 00:00:00 2001 From: Stefano Brivio Date: Sat, 26 Feb 2022 23:29:18 +0100 Subject: seccomp.sh: Handle syscall number defines in the (x + y) form This is the case at least for current glibc headers on armv6l and armv7l. Signed-off-by: Stefano Brivio --- seccomp.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/seccomp.sh b/seccomp.sh index f5ee98e..6ac59a1 100755 --- a/seccomp.sh +++ b/seccomp.sh @@ -109,6 +109,9 @@ syscall_nr() { __in="$(printf "#include \n#include \n__NR_%s" ${1})" __out="$(echo "${__in}" | cc -E -xc - -o - | tail -1)" [ "${__out}" = "__NR_$1" ] && return 1 + + # Output might be in the form "(x + y)" (seen on armv6l, armv7l) + __out="$(eval echo $((${__out})))" echo "${__out}" } -- cgit v1.2.3