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
|
#include <signal.h>
#include <string.h>
#include "locale_impl.h"
#if (SIGHUP == 1) && (SIGINT == 2) && (SIGQUIT == 3) && (SIGILL == 4) \
&& (SIGTRAP == 5) && (SIGABRT == 6) && (SIGBUS == 7) && (SIGFPE == 8) \
&& (SIGKILL == 9) && (SIGUSR1 == 10) && (SIGSEGV == 11) && (SIGUSR2 == 12) \
&& (SIGPIPE == 13) && (SIGALRM == 14) && (SIGTERM == 15) && (SIGSTKFLT == 16) \
&& (SIGCHLD == 17) && (SIGCONT == 18) && (SIGSTOP == 19) && (SIGTSTP == 20) \
&& (SIGTTIN == 21) && (SIGTTOU == 22) && (SIGURG == 23) && (SIGXCPU == 24) \
&& (SIGXFSZ == 25) && (SIGVTALRM == 26) && (SIGPROF == 27) && (SIGWINCH == 28) \
&& (SIGPOLL == 29) && (SIGPWR == 30) && (SIGSYS == 31)
#define sigmap(x) x
#else
static const char map[] = {
[SIGHUP] = 1,
[SIGINT] = 2,
[SIGQUIT] = 3,
[SIGILL] = 4,
[SIGTRAP] = 5,
[SIGABRT] = 6,
[SIGBUS] = 7,
[SIGFPE] = 8,
[SIGKILL] = 9,
[SIGUSR1] = 10,
[SIGSEGV] = 11,
[SIGUSR2] = 12,
[SIGPIPE] = 13,
[SIGALRM] = 14,
[SIGTERM] = 15,
[SIGSTKFLT] = 16,
[SIGCHLD] = 17,
[SIGCONT] = 18,
[SIGSTOP] = 19,
[SIGTSTP] = 20,
[SIGTTIN] = 21,
[SIGTTOU] = 22,
[SIGURG] = 23,
[SIGXCPU] = 24,
[SIGXFSZ] = 25,
[SIGVTALRM] = 26,
[SIGPROF] = 27,
[SIGWINCH] = 28,
[SIGPOLL] = 29,
[SIGPWR] = 30,
[SIGSYS] = 31
};
#define sigmap(x) ((x) >= sizeof map ? (x) : map[(x)])
#endif
static const char strings[] =
"Unknown signal0円"
"Hangup0円"
"Interrupt0円"
"Quit0円"
"Illegal instruction0円"
"Trace/breakpoint trap0円"
"Aborted0円"
"Bus error0円"
"Arithmetic exception0円"
"Killed0円"
"User defined signal 10円"
"Segmentation fault0円"
"User defined signal 20円"
"Broken pipe0円"
"Alarm clock0円"
"Terminated0円"
"Stack fault0円"
"Child process status0円"
"Continued0円"
"Stopped (signal)0円"
"Stopped0円"
"Stopped (tty input)0円"
"Stopped (tty output)0円"
"Urgent I/O condition0円"
"CPU time limit exceeded0円"
"File size limit exceeded0円"
"Virtual timer expired0円"
"Profiling timer expired0円"
"Window changed0円"
"I/O possible0円"
"Power failure0円"
"Bad system call0円"
"RT32"
"0円RT330円RT340円RT350円RT360円RT370円RT380円RT390円RT40"
"0円RT410円RT420円RT430円RT440円RT450円RT460円RT470円RT48"
"0円RT490円RT500円RT510円RT520円RT530円RT540円RT550円RT56"
"0円RT570円RT580円RT590円RT600円RT610円RT620円RT630円RT64"
#if _NSIG > 65
"0円RT650円RT660円RT670円RT680円RT690円RT700円RT710円RT72"
"0円RT730円RT740円RT750円RT760円RT770円RT780円RT790円RT80"
"0円RT810円RT820円RT830円RT840円RT850円RT860円RT870円RT88"
"0円RT890円RT900円RT910円RT920円RT930円RT940円RT950円RT96"
"0円RT970円RT980円RT990円RT1000円RT1010円RT1020円RT1030円RT104"
"0円RT1050円RT1060円RT1070円RT1080円RT1090円RT1100円RT1110円RT112"
"0円RT1130円RT1140円RT1150円RT1160円RT1170円RT1180円RT1190円RT120"
"0円RT1210円RT1220円RT1230円RT1240円RT1250円RT1260円RT1270円RT128"
#endif
"";
char *strsignal(int signum)
{
const char *s = strings;
signum = sigmap(signum);
if (signum - 1U >= _NSIG-1) signum = 0;
for (; signum--; s++) for (; *s; s++);
return (char *)LCTRANS_CUR(s);
}
|