1#!/usr/bin/env bash
2# SPDX-License-Identifier: LGPL-2.1-or-later
3set -eu
4set -o pipefail
5
6# In kernel's arch/parisc/include/uapi/asm/errno.h, ECANCELLED and EREFUSED are defined as aliases of
7# ECANCELED and ECONNREFUSED, respectively. Let's drop them.
8
9${1:?} -dM -include errno.h - </dev/null | \
10       grep -Ev '^#define[[:space:]]+(ECANCELLED|EREFUSED)' | \
11       awk '/^#define[ \t]+E[^ _]+[ \t]+/ { print $2; }'
12