summaryrefslogtreecommitdiff
path: root/build-aux/linux-errno.txt.gen
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-31 15:39:37 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-31 16:00:34 -0600
commit3c81186daf97cf7011fd2806dfd0bc3b875e92f3 (patch)
tree30a6a4b50ab2eb15e7c6dcf934dc6052bbea0224 /build-aux/linux-errno.txt.gen
parentf2d53195fd86023d2ff9fcce68d2e150bfd97059 (diff)
Clean up the build system
Diffstat (limited to 'build-aux/linux-errno.txt.gen')
-rwxr-xr-xbuild-aux/linux-errno.txt.gen17
1 files changed, 17 insertions, 0 deletions
diff --git a/build-aux/linux-errno.txt.gen b/build-aux/linux-errno.txt.gen
new file mode 100755
index 0000000..f94178f
--- /dev/null
+++ b/build-aux/linux-errno.txt.gen
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# build-aux/linux-errno.txt.gen - Generate a listing of Linux kernel errnos
+#
+# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+# SPDX-License-Identifier: AGPL-3.0-or-later
+
+set -e
+linux_git=${1:?}
+outfile=${2:?}
+
+(
+ cd "${linux_git}"
+ echo "# ${outfile} - Generated from $0 and linux.git $(git describe). DO NOT EDIT!"
+ git ls-files include/uapi/ | grep errno |
+ xargs sed -nE 's,#\s*define\s+(E[A-Z0-9]+)\s+([0-9]+)\s+/\* (.*) \*/,\2 \1 \3,p' |
+ sort --numeric-sort
+) >"${outfile}"