]>
Commit | Line | Data |
---|---|---|
c40293ed | 1 | #!/bin/bash |
69e542bd | 2 | |
8e7f8b4d | 3 | set -e |
7522d8df | 4 | set -o pipefail |
8e7f8b4d | 5 | |
543f991f TW |
6 | AWK="$1" |
7 | shift | |
69e542bd TW |
8 | OUTPUT=syscalls.h |
9 | SYSCALL_INCLUDES=" | |
10 | #include <sys/syscall.h> | |
11 | " | |
12 | ||
4d5441ec | 13 | trap 'rm -f $OUTPUT $OUTPUT.deps' ERR |
69e542bd | 14 | |
c40293ed | 15 | "$@" -MD -MF "$OUTPUT.deps" <<< "$SYSCALL_INCLUDES" -dM -E - \ |
543f991f | 16 | | "$AWK" 'match($0, /^#define __NR_([^ ]+)/, res) { print "UL_SYSCALL(\"" res[1] "\", __NR_" res[1] ")" }' \ |
69e542bd | 17 | | sort \ |
8e7f8b4d | 18 | > "$OUTPUT" |