1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
/* Abbreviated name of signals.
Copyright (C) 2020-2021 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* Written by Bruno Haible <bruno@clisp.org>, 2020. */
#include <config.h>
/* Specification. */
#include <string.h>
#include <signal.h>
const char *
sigabbrev_np (int sig)
{
switch (sig)
{
/* Signals specified by ISO C. */
case SIGABRT: return "ABRT";
case SIGFPE: return "FPE";
case SIGILL: return "ILL";
case SIGINT: return "INT";
case SIGSEGV: return "SEGV";
case SIGTERM: return "TERM";
/* Signals specified by POSIX.
<https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html> */
#if defined SIGALRM
case SIGALRM: return "ALRM";
#endif
#if defined SIGBUS
case SIGBUS: return "BUS";
#endif
#if defined SIGCHLD
case SIGCHLD: return "CHLD";
#endif
#if defined SIGCONT
case SIGCONT: return "CONT";
#endif
#if defined SIGHUP
case SIGHUP: return "HUP";
#endif
#if defined SIGKILL
case SIGKILL: return "KILL";
#endif
#if defined SIGPIPE
case SIGPIPE: return "PIPE";
#endif
#if defined SIGQUIT
case SIGQUIT: return "QUIT";
#endif
#if defined SIGSTOP
case SIGSTOP: return "STOP";
#endif
#if defined SIGTSTP
case SIGTSTP: return "TSTP";
#endif
#if defined SIGTTIN
case SIGTTIN: return "TTIN";
#endif
#if defined SIGTTOU
case SIGTTOU: return "TTOU";
#endif
#if defined SIGUSR1
case SIGUSR1: return "USR1";
#endif
#if defined SIGUSR2
case SIGUSR2: return "USR2";
#endif
#if defined SIGPOLL
case SIGPOLL: return "POLL";
#endif
#if defined SIGPROF
case SIGPROF: return "PROF";
#endif
#if defined SIGSYS
case SIGSYS: return "SYS";
#endif
#if defined SIGTRAP
case SIGTRAP: return "TRAP";
#endif
#if defined SIGURG
case SIGURG: return "URG";
#endif
#if defined SIGVTALRM
case SIGVTALRM: return "VTALRM";
#endif
#if defined SIGXCPU
case SIGXCPU: return "XCPU";
#endif
#if defined SIGXFSZ
case SIGXFSZ: return "XFSZ";
#endif
/* Other signals on other systems. */
/* native Windows */
#if defined SIGBREAK
case SIGBREAK: return "BREAK";
#endif
/* IRIX */
#if defined SIGCKPT
case SIGCKPT: return "CKPT";
#endif
/* Linux, IRIX, Cygwin */
#if defined SIGCLD && SIGCLD != SIGCHLD
case SIGCLD: return "CLD";
#endif
/* AIX */
#if defined SIGCPUFAIL
case SIGCPUFAIL: return "CPUFAIL";
#endif
/* AIX */
#if defined SIGDANGER
case SIGDANGER: return "DANGER";
#endif
/* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, mingw */
#if defined SIGEMT
case SIGEMT: return "EMT";
#endif
/* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
#if defined SIGINFO
case SIGINFO: return "INFO";
#endif
/* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin */
#if defined SIGIO && SIGIO != SIGPOLL
case SIGIO: return "IO";
#endif
/* Linux, IRIX, Cygwin, mingw */
#if defined SIGIOT && SIGIOT != SIGABRT
case SIGIOT: return "IOT";
#endif
/* AIX */
#if defined SIGKAP
case SIGKAP: return "KAP";
#endif
/* Haiku */
#if defined SIGKILLTHR
case SIGKILLTHR: return "KILLTHR";
#endif
/* Minix */
#if defined SIGKMEM
case SIGKMEM: return "KMEM";
#endif
/* Minix */
#if defined SIGKMESS
case SIGKMESS: return "KMESS";
#endif
/* Minix */
#if defined SIGKSIG
case SIGKSIG: return "KSIG";
#endif
/* Minix */
#if defined SIGKSIGSM
case SIGKSIGSM: return "KSIGSM";
#endif
/* FreeBSD */
#if defined SIGLIBRT
case SIGLIBRT: return "LIBRT";
#endif
/* Cygwin */
#if defined SIGLOST && SIGLOST != SIGABRT && SIGLOST != SIGPWR
case SIGLOST: return "LOST";
#endif
/* AIX */
#if defined SIGMIGRATE
case SIGMIGRATE: return "MIGRATE";
#endif
/* AIX */
#if defined SIGMSG
case SIGMSG: return "MSG";
#endif
/* AIX */
#if defined SIGPRE
case SIGPRE: return "PRE";
#endif
/* IRIX */
#if defined SIGPTINTR
case SIGPTINTR: return "PTINTR";
#endif
/* IRIX */
#if defined SIGPTRESCHED
case SIGPTRESCHED:return "PTRESCHED";
#endif
/* Linux, NetBSD, Minix, AIX, IRIX, Cygwin */
#if defined SIGPWR
case SIGPWR: return "PWR";
#endif
/* AIX */
#if defined SIGRECONFIG
case SIGRECONFIG: return "RECONFIG";
#endif
/* AIX */
#if defined SIGRECOVERY
case SIGRECOVERY: return "RECOVERY";
#endif
/* IRIX */
#if defined SIGRESTART
case SIGRESTART: return "RESTART";
#endif
/* AIX */
#if defined SIGRETRACT
case SIGRETRACT: return "RETRACT";
#endif
/* AIX */
#if defined SIGSAK
case SIGSAK: return "SAK";
#endif
/* Minix */
#if defined SIGSNDELAY
case SIGSNDELAY: return "SNDELAY";
#endif
/* AIX */
#if defined SIGSOUND
case SIGSOUND: return "SOUND";
#endif
/* Linux */
#if defined SIGSTKFLT
case SIGSTKFLT: return "STKFLT";
#endif
/* AIX */
#if defined SIGSYSERROR
case SIGSYSERROR: return "SYSERROR";
#endif
/* AIX */
#if defined SIGTALRM
case SIGTALRM: return "TALRM";
#endif
/* FreeBSD, OpenBSD */
#if defined SIGTHR
case SIGTHR: return "THR";
#endif
/* IRIX */
#if defined SIGUME
case SIGUME: return "UME";
#endif
/* AIX */
#if defined SIGVIRT
case SIGVIRT: return "VIRT";
#endif
/* AIX */
#if defined SIGWAITING
case SIGWAITING: return "WAITING";
#endif
/* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, Haiku */
#if defined SIGWINCH
case SIGWINCH: return "WINCH";
#endif
default:
return NULL;
}
}
|