From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 3/7] seccomp.sh: Handle syscall number defines in the (x + y) form Date: Sat, 26 Feb 2022 23:56:42 +0100 Message-ID: <20220226225646.1905417-4-sbrivio@redhat.com> In-Reply-To: <20220226225646.1905417-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6140983934788373030==" --===============6140983934788373030== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=3D"$(printf "#include \n#include = \n__NR_%s" ${1})" __out=3D"$(echo "${__in}" | cc -E -xc - -o - | tail -1)" [ "${__out}" =3D "__NR_$1" ] && return 1 + + # Output might be in the form "(x + y)" (seen on armv6l, armv7l) + __out=3D"$(eval echo $((${__out})))" echo "${__out}" } =20 --=20 2.34.1 --===============6140983934788373030==--