1 /* English descriptions of signals.
2 Copyright (C) 2020-2025 Free Software Foundation, Inc.
4 This file is free software: you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2.1 of the
7 License, or (at your option) any later version.
9 This file 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 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser 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. */
29 /* Note: Some platforms (glibc, FreeBSD, NetBSD, OpenBSD, AIX, IRIX, Haiku,
30 Android) have an array 'sys_siglist'. (On AIX, you need to declare it
31 yourself, and it has fewer than NSIG elements.) Its contents varies
33 On other OSes, you can invoke strsignal (sig) in the C locale.
34 In the code below, we show the differences.
35 You can see how cryptic some of these strings are. We try to pick more
36 understandable wordings. */
40 /* Signals specified by ISO C. */
42 /* glibc: "Aborted". *BSD: "Abort trap". Solaris: "Abort". */
45 /* glibc, *BSD: "Floating point exception". Solaris: "Arithmetic exception".
46 The latter is more correct, because of integer division by 0 or -1. */
47 return "Arithmetic exception";
49 return "Illegal instruction";
53 return "Segmentation fault";
57 /* Signals specified by POSIX.
58 <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html> */
69 /* glibc, *BSD: "Child exited". Solaris: "Child status changed". */
70 return "Child stopped or exited";
94 /* glibc, Solaris: "Stopped (signal)". *BSD: "Suspended (signal)". */
95 return "Stopped (signal)";
99 /* glibc: "Stopped". *BSD: "Suspended". Solaris: "Stopped (user)". */
104 return "Stopped (tty input)";
108 return "Stopped (tty output)";
112 /* glibc, *BSD: "User defined signal 1". Solaris: "User signal 1". */
113 return "User defined signal 1";
117 /* glibc, *BSD: "User defined signal 2". Solaris: "User signal 2". */
118 return "User defined signal 2";
122 /* glibc: "I/O possible". Solaris: "Pollable event". */
123 return "I/O possible";
127 return "Profiling timer expired";
131 return "Bad system call";
135 /* glibc, Solaris: "Trace/breakpoint trap". *BSD: "Trace/BPT trap". */
136 return "Trace/breakpoint trap";
140 /* glibc, *BSD: "Urgent I/O condition". Solaris: "Urgent socket condition". */
141 return "Urgent I/O condition";
143 #if defined SIGVTALRM
145 return "Virtual timer expired";
149 /* glibc, *BSD: "CPU time limit exceeded". Solaris: "Cpu limit exceeded". */
150 return "CPU time limit exceeded";
154 return "File size limit exceeded";
157 /* Other signals on other systems. */
166 return "Checkpoint"; /* See man 1 cpr, man 3C atcheckpoint */
168 /* Linux, IRIX, Cygwin */
169 #if defined SIGCLD && SIGCLD != SIGCHLD
171 return "Child stopped or exited";
174 #if defined SIGCPUFAIL
176 /* AIX: "CPU failure predicted". */
177 return "CPU going down"; /* See man bindprocessor */
180 #if defined SIGDANGER
182 /* AIX: "Paging space low". */
183 return "Swap space nearly exhausted";
185 /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, mingw */
188 /* glibc/Hurd, *BSD: "EMT trap". Solaris: "Emulation trap". */
189 return "Instruction emulation needed";
191 /* Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix */
192 #if defined SIGINFO && SIGINFO != SIGPWR
194 return "Information request";
196 /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin */
197 #if defined SIGIO && SIGIO != SIGPOLL
199 return "I/O possible";
201 /* Linux, IRIX, Cygwin, mingw */
202 #if defined SIGIOT && SIGIOT != SIGABRT
204 return "IOT instruction"; /* a PDP-11 instruction */
209 /* Process must issue a KSKAPACK ioctl, or will be killed in 30 seconds. */
210 /* AIX: "Monitor mode granted". */
211 return "Keep Alive Poll";
214 #if defined SIGKILLTHR
216 return "Kill thread";
221 return "Kernel memory request";
226 return "Kernel message";
231 return "Kernel signal";
234 #if defined SIGKSIGSM
236 return "Kernel signal for signal manager";
241 return "Real-time library interrupt";
244 #if defined SIGLOST && SIGLOST != SIGABRT && SIGLOST != SIGPWR
246 /* Solaris: "Resource lost". */
247 return "File lock lost";
250 #if defined SIGMIGRATE
252 return "Process migration";
257 /* AIX: "Input device data". */
258 return "Message in the ring";
263 return "Programming language anomaly";
268 return "Programmed exception";
271 #if defined SIGPTINTR
273 return "Pthread interrupt";
276 #if defined SIGPTRESCHED
278 return "Pthread rescheduling";
280 /* Linux, NetBSD, Minix, AIX, IRIX, Cygwin */
283 /* glibc: "Power failure". NetBSD: "Power fail/restart". */
284 return "Power failure";
287 #if defined SIGRECONFIG
289 return "Dynamic logical partitioning changed";
292 #if defined SIGRECOVERY
294 return "Kernel recovery";
297 #if defined SIGRESTART
299 return "Checkpoint restart"; /* See man 1 cpr, man 3C atrestart */
302 #if defined SIGRETRACT
304 /* AIX: "Monitor mode retracted". */
305 return "Retracting Keep Alive Poll";
310 /* AIX: "Secure attention". */
311 return "Secure Attention Key";
316 return "Symbolic computation failed";
319 #if defined SIGSNDELAY
321 return "Done sending message";
326 /* AIX: "Sound completed". */
327 return "Sound configuration changed";
330 #if defined SIGSTKFLT
332 return "Stack fault";
335 #if defined SIGSYSERROR
337 return "Kernel error";
342 return "Thread alarm clock";
344 /* FreeBSD, OpenBSD */
347 /* OpenBSD: "Thread AST". */
348 return "Thread library interrupt";
353 return "Uncorrectable memory error";
358 return "Virtual time alarm clock";
361 #if defined SIGWAITING
363 /* AIX: "No runnable lwp". */
364 return "Thread waiting";
366 /* Linux, Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, AIX, IRIX, Cygwin, Haiku */
369 /* glibc: "Window changed". *BSD: "Window size changed" or "Window size changes". */
370 return "Window size changed";