summaryrefslogtreecommitdiff
path: root/3rd-party/linux-errno.txt.gen
blob: abfbe95ef3815dcfc66ffc1a6913c776ab937bb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
# 3rd-party/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
(
	cd "$1"
	echo "# ${0%.gen} - Generated from 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
) >"${0%.gen}"