1
0
Fork 0
util-linux/tools/all_errnos
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

21 lines
345 B
Bash
Executable file

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