diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-04-05 18:23:23 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-04-05 18:26:28 -0400 |
commit | f86f006b78a3c1c9c6deb45dba74029148abaf76 (patch) | |
tree | 190a2674044b0c45f254dc61db2a398b1c7b25c4 /scripts | |
parent | tests: drop O_DIRECTORY (diff) | |
download | sandbox-f86f006b78a3c1c9c6deb45dba74029148abaf76.tar.gz sandbox-f86f006b78a3c1c9c6deb45dba74029148abaf76.tar.bz2 sandbox-f86f006b78a3c1c9c6deb45dba74029148abaf76.zip |
libsandbox: accept flexible syscall defines
Most systems define the syscall numbers as a plain int, but others use a
base and an offset (like arm). So work with that format as well.
URL: http://bugs.gentoo.org/265020
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Reported-by: Ryan Tandy <tarpman@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/gen_trace_header.awk | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/gen_trace_header.awk b/scripts/gen_trace_header.awk index 75f4f02..846294c 100644 --- a/scripts/gen_trace_header.awk +++ b/scripts/gen_trace_header.awk @@ -18,7 +18,7 @@ function out(name, val) } { - # found: SB_func = # + # found: SB_func = <something> # not found: SB_func = SYS_func if ($1 !~ /^SB_/) next; @@ -26,14 +26,18 @@ function out(name, val) next; sub(/^SB_/, "", $1); + name = $1 + # accept everything after the "=" in case it's either + # a straight number or an expression (a syscall base) + sub(/^[^=]*= /, ""); for (i = 1; i <= COUNT; ++i) - if (SYMBOLS[i] == $1) { + if (SYMBOLS[i] == name) { SYMBOLS[i] = ""; break; } - out($1, $3); + out(name, $0); } END { |