1
0
Fork 0
util-linux/tools/all_syscalls
Daniel Baumann c36e531662
Adding upstream version 2.41.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-21 11:26:35 +02:00

19 lines
319 B
Bash
Executable file

#!/bin/bash
set -e
set -o pipefail
SED="$1"
shift
OUTPUT="$1"
shift
SYSCALL_INCLUDES="
#include <sys/syscall.h>
"
trap 'rm -f $OUTPUT $OUTPUT.deps' ERR
"$@" -MD -MF "$OUTPUT.deps" <<< "$SYSCALL_INCLUDES" -dM -E - \
| "$SED" -n -e 's/^#define __NR_\([^ ]*\).*$/UL_SYSCALL("\1", __NR_\1)/p' \
| sort \
> "$OUTPUT"