aboutgitcodebugslistschat
path: root/seccomp.sh
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2022-02-26 23:29:18 +0100
committerStefano Brivio <sbrivio@redhat.com>2022-02-26 23:32:02 +0100
commit601f7ee78ece7d54a12cf9191d23a3ec516d8948 (patch)
tree6ab85a5cb546211c63fb1df9e010caf160248e37 /seccomp.sh
parenteed6933e6c29b131955c599bf54c4c4c3367491d (diff)
downloadpasst-601f7ee78ece7d54a12cf9191d23a3ec516d8948.tar
passt-601f7ee78ece7d54a12cf9191d23a3ec516d8948.tar.gz
passt-601f7ee78ece7d54a12cf9191d23a3ec516d8948.tar.bz2
passt-601f7ee78ece7d54a12cf9191d23a3ec516d8948.tar.lz
passt-601f7ee78ece7d54a12cf9191d23a3ec516d8948.tar.xz
passt-601f7ee78ece7d54a12cf9191d23a3ec516d8948.tar.zst
passt-601f7ee78ece7d54a12cf9191d23a3ec516d8948.zip
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 <sbrivio@redhat.com>
Diffstat (limited to 'seccomp.sh')
-rwxr-xr-xseccomp.sh3
1 files changed, 3 insertions, 0 deletions
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 <asm-generic/unistd.h>\n#include <sys/syscall.h>\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}"
}