blob: 2cfb14bc3a6592c77c3b8ca19f075a4f0dd7f336 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/bash
# Derrived from all_syscalls.
set -e
OUTPUT=errnos.h
ERRNO_INCLUDES="
#include <sys/errno.h>
"
trap 'rm $OUTPUT $OUTPUT.deps' ERR
"$@" -MD -MF "$OUTPUT.deps" <<< "$ERRNO_INCLUDES" -dM -E - \
| gawk 'match($0, /^#[ \t]*define[ \t]*E([^ ]+)/, res) { print "UL_ERRNO(\"E" res[1] "\", E" res[1] ")" }' \
| sort \
> "$OUTPUT"
|