sys_signame.sh (687B)
- #!/bin/sh
- cat <<-EOF
- // utils-std: Collection of commonly available Unix tools
- // SPDX-FileCopyrightText: 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- // SPDX-License-Identifier: CC0-1.0 OR WTFPL
- // /!\ File generated by lib/sys_signame.sh avoid editing
- #include "sys_signame.h"
- const char *util_sys_signame[NSIG] = {
- EOF
- # From signal.h definition in POSIX
- for i in SIGABRT SIGALRM SIGBUS SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 SIGWINCH SIGSYS SIGTRAP SIGURG SIGVTALRM SIGXCPU SIGXFSZ
- do
- printf '#ifdef %s\n\t[%s] = "%s",\n#endif\n' "$i" "$i" "${i#SIG}"
- done
- printf '};\n'