summaryrefslogtreecommitdiffstats
path: root/tools/all_syscalls
blob: 9c147786cfee360a0eeb0b1c97fb1d21c24e68e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

set -e

OUTPUT=syscalls.h
SYSCALL_INCLUDES="
#include <sys/syscall.h>
"

trap 'rm $OUTPUT $OUTPUT.deps' ERR

"$@" -MD -MF "$OUTPUT.deps" <<< "$SYSCALL_INCLUDES" -dM -E - \
	| gawk 'match($0, /^#define __NR_([^ ]+)/, res) { print "UL_SYSCALL(\"" res[1] "\", __NR_" res[1] ")" }' \
	| sort \
	> "$OUTPUT"