1 /* Abbreviated name of signals.
2 Copyright (C) 2020 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>. */
17 /* Written by Bruno Haible <bruno@clisp.org>, 2020. */
27 sigabbrev_np (int sig
)
31 /* Signals specified by ISO C. */
32 case SIGABRT
: return "ABRT";
33 case SIGFPE
: return "FPE";
34 case SIGILL
: return "ILL";
35 case SIGINT
: return "INT";
36 case SIGSEGV
: return "SEGV";
37 case SIGTERM
: return "TERM";
39 /* Signals specified by POSIX.
40 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html> */
42 case SIGALRM
: return "ALRM";
45 case SIGBUS
: return "BUS";
48 case SIGCHLD
: return "CHLD";
51 case SIGCONT
: return "CONT";
54 case SIGHUP
: return "HUP";
57 case SIGKILL
: return "KILL";
60 case SIGPIPE
: return "PIPE";
63 case SIGQUIT
: return "QUIT";
66 case SIGSTOP
: return "STOP";
69 case SIGTSTP
: return "TSTP";
72 case SIGTTIN
: return "TTIN";
75 case SIGTTOU
: return "TTOU";
78 case SIGUSR1
: return "USR1";
81 case SIGUSR2
: return "USR2";
84 case SIGPOLL
: return "POLL";
87 case SIGPROF
: return "PROF";
90 case SIGSYS
: return "SYS";
93 case SIGTRAP
: return "TRAP";
96 case SIGURG
: return "URG";
99 case SIGVTALRM
: return "VTALRM";
102 case SIGXCPU
: return "XCPU";
105 case SIGXFSZ
: return "XFSZ";
108 /* Other signals on other systems. */
111 case SIGBREAK
: return "BREAK";
115 case SIGCKPT
: return "CKPT";
117 /* Linux, IRIX, Cygwin */
118 #if defined SIGCLD && SIGCLD != SIGCHLD
119 case SIGCLD
: return "CLD";
122 #if defined SIGCPUFAIL
123 case SIGCPUFAIL
: return "CPUFAIL";
126 #if defined SIGDANGER
127 case SIGDANGER
: return "DANGER";
129 /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, mingw */
131 case SIGEMT
: return "EMT";
133 /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
135 case SIGINFO
: return "INFO";
137 /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin */
138 #if defined SIGIO && SIGIO != SIGPOLL
139 case SIGIO
: return "IO";
141 /* Linux, IRIX, Cygwin, mingw */
142 #if defined SIGIOT && SIGIOT != SIGABRT
143 case SIGIOT
: return "IOT";
147 case SIGKAP
: return "KAP";
150 #if defined SIGKILLTHR
151 case SIGKILLTHR
: return "KILLTHR";
155 case SIGKMEM
: return "KMEM";
159 case SIGKMESS
: return "KMESS";
163 case SIGKSIG
: return "KSIG";
166 #if defined SIGKSIGSM
167 case SIGKSIGSM
: return "KSIGSM";
171 case SIGLIBRT
: return "LIBRT";
174 #if defined SIGLOST && SIGLOST != SIGABRT && SIGLOST != SIGPWR
175 case SIGLOST
: return "LOST";
178 #if defined SIGMIGRATE
179 case SIGMIGRATE
: return "MIGRATE";
183 case SIGMSG
: return "MSG";
187 case SIGPRE
: return "PRE";
190 #if defined SIGPTINTR
191 case SIGPTINTR
: return "PTINTR";
194 #if defined SIGPTRESCHED
195 case SIGPTRESCHED
:return "PTRESCHED";
197 /* Linux, NetBSD, Minix, AIX, IRIX, Cygwin */
199 case SIGPWR
: return "PWR";
202 #if defined SIGRECONFIG
203 case SIGRECONFIG
: return "RECONFIG";
206 #if defined SIGRECOVERY
207 case SIGRECOVERY
: return "RECOVERY";
210 #if defined SIGRESTART
211 case SIGRESTART
: return "RESTART";
214 #if defined SIGRETRACT
215 case SIGRETRACT
: return "RETRACT";
219 case SIGSAK
: return "SAK";
222 #if defined SIGSNDELAY
223 case SIGSNDELAY
: return "SNDELAY";
227 case SIGSOUND
: return "SOUND";
230 #if defined SIGSTKFLT
231 case SIGSTKFLT
: return "STKFLT";
234 #if defined SIGSYSERROR
235 case SIGSYSERROR
: return "SYSERROR";
239 case SIGTALRM
: return "TALRM";
241 /* FreeBSD, OpenBSD */
243 case SIGTHR
: return "THR";
247 case SIGUME
: return "UME";
251 case SIGVIRT
: return "VIRT";
254 #if defined SIGWAITING
255 case SIGWAITING
: return "WAITING";
257 /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, Haiku */
259 case SIGWINCH
: return "WINCH";