#!/usr/bin/env bash # build-aux/linux-errno.txt.gen - Generate a listing of Linux kernel errnos # # Copyright (C) 2024 Luke T. Shumaker # 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}"