summaryrefslogtreecommitdiff
path: root/src/basic/generate-errno-list.sh
blob: f756b2e020834d5ec10f7c05177213f8d1595c97 (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/env bash
# SPDX-License-Identifier: LGPL-2.1-or-later
set -eu
set -o pipefail

# In kernel's arch/parisc/include/uapi/asm/errno.h, ECANCELLED and EREFUSED are defined as aliases of
# ECANCELED and ECONNREFUSED, respectively. Let's drop them.

${1:?} -dM -include errno.h - </dev/null | \
       grep -Ev '^#define[[:space:]]+(ECANCELLED|EREFUSED)' | \
       awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'