diff options
author | Paul Moore <pmoore@redhat.com> | 2014-08-19 22:47:36 -0400 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2014-08-20 11:45:52 -0400 |
commit | f8700e2901b882249348b7d0e63824e64420f5d9 (patch) | |
tree | 1f585ca26c03bbd4f182d2c1788a402b94db3cc7 /src/arch-syscall-validate | |
parent | 0783d0389450a4774f960b5af7a78cdb67c6f7ee (diff) | |
download | libseccomp-f8700e2901b882249348b7d0e63824e64420f5d9.tar.gz |
arch: fix the arch-syscall-validate script for x86/x86_64/x32
Don't rely on the header files for x86/x86_64/x32, check the syscall
source tables directly.
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'src/arch-syscall-validate')
-rwxr-xr-x | src/arch-syscall-validate | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/arch-syscall-validate b/src/arch-syscall-validate index e765c35..740ab77 100755 --- a/src/arch-syscall-validate +++ b/src/arch-syscall-validate @@ -75,9 +75,9 @@ EOF # Dump the architecture's syscall table to stdout. # function dump_sys_x86() { - cat $1/arch/x86/include/generated/uapi/asm/unistd_32.h | \ - grep "^#define __NR_" | sort | \ - sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+\(.*\).*/\1\t\2/' + cat $1/arch/x86/syscalls/syscall_32.tbl | \ + grep -v "^#" | awk '{ print $3"\t"$1 }' | sed '/^[ \t]*$/d' | \ + sort } # @@ -98,9 +98,9 @@ function dump_lib_x86() { # Dump the architecture's syscall table to stdout. # function dump_sys_x86_64() { - cat $1/arch/x86/include/generated/uapi/asm/unistd_64.h | \ - grep "^#define __NR_" | sort | \ - sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+\(.*\).*/\1\t\2/' + cat $1/arch/x86/syscalls/syscall_64.tbl | \ + grep -v "^#" | awk '{ print $2,$3,$1 }' | sed -e '/^x32/d' | \ + awk '{ print $2"\t"$3 }' | sed '/^[ \t]*$/d' | sort } # @@ -121,9 +121,9 @@ function dump_lib_x86_64() { # Dump the architecture's syscall table to stdout. # function dump_sys_x32() { - cat $1/arch/x86/include/generated/uapi/asm/unistd_x32.h | \ - grep "^#define __NR_" | sort | \ - sed -e 's/#define[ \t]\+__NR_\([^ \t]\+\)[ \t]\+(__X32_SYSCALL_BIT[ \t]*+[ \t]*\([0-9]\+\)).*/\1\t\2/' + cat $1/arch/x86/syscalls/syscall_64.tbl | \ + grep -v "^#" | awk '{ print $2,$3,$1 }' | sed -e '/^64/d' | \ + awk '{ print $2"\t"$3 }' | sed '/^[ \t]*$/d' | sort } # |