]> git.ipfire.org Git - thirdparty/bash.git/blame_incremental - siglist.c
Bash-4.3 patch 22
[thirdparty/bash.git] / siglist.c
... / ...
CommitLineData
1/* siglist.c -- signal list for those machines that don't have one. */
2
3/* Copyright (C) 1989-2009 Free Software Foundation, Inc.
4
5 This file is part of GNU Bash, the Bourne Again SHell.
6
7 Bash is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 Bash is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Bash. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#include "config.h"
22
23#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_UNDER_SYS_SIGLIST) && !defined (HAVE_STRSIGNAL)
24
25#include <stdio.h>
26#include "bashtypes.h"
27#include <signal.h>
28
29#include "siglist.h"
30
31#if !defined (NSIG)
32# include "trap.h"
33#endif
34
35#include "bashintl.h"
36#include "xmalloc.h"
37
38char *sys_siglist[NSIG];
39
40void
41initialize_siglist ()
42{
43 register int i;
44
45 for (i = 0; i < NSIG; i++)
46 sys_siglist[i] = (char *)0x0;
47
48 sys_siglist[0] = _("Bogus signal");
49
50#if defined (SIGHUP)
51 sys_siglist[SIGHUP] = _("Hangup");
52#endif
53
54#if defined (SIGINT)
55 sys_siglist[SIGINT] = _("Interrupt");
56#endif
57
58#if defined (SIGQUIT)
59 sys_siglist[SIGQUIT] = _("Quit");
60#endif
61
62#if defined (SIGILL)
63 sys_siglist[SIGILL] = _("Illegal instruction");
64#endif
65
66#if defined (SIGTRAP)
67 sys_siglist[SIGTRAP] = _("BPT trace/trap");
68#endif
69
70#if defined (SIGIOT) && !defined (SIGABRT)
71#define SIGABRT SIGIOT
72#endif
73
74#if defined (SIGABRT)
75 sys_siglist[SIGABRT] = _("ABORT instruction");
76#endif
77
78#if defined (SIGEMT)
79 sys_siglist[SIGEMT] = _("EMT instruction");
80#endif
81
82#if defined (SIGFPE)
83 sys_siglist[SIGFPE] = _("Floating point exception");
84#endif
85
86#if defined (SIGKILL)
87 sys_siglist[SIGKILL] = _("Killed");
88#endif
89
90#if defined (SIGBUS)
91 sys_siglist[SIGBUS] = _("Bus error");
92#endif
93
94#if defined (SIGSEGV)
95 sys_siglist[SIGSEGV] = _("Segmentation fault");
96#endif
97
98#if defined (SIGSYS)
99 sys_siglist[SIGSYS] = _("Bad system call");
100#endif
101
102#if defined (SIGPIPE)
103 sys_siglist[SIGPIPE] = _("Broken pipe");
104#endif
105
106#if defined (SIGALRM)
107 sys_siglist[SIGALRM] = _("Alarm clock");
108#endif
109
110#if defined (SIGTERM)
111 sys_siglist[SIGTERM] = _("Terminated");
112#endif
113
114#if defined (SIGURG)
115 sys_siglist[SIGURG] = _("Urgent IO condition");
116#endif
117
118#if defined (SIGSTOP)
119 sys_siglist[SIGSTOP] = _("Stopped (signal)");
120#endif
121
122#if defined (SIGTSTP)
123 sys_siglist[SIGTSTP] = _("Stopped");
124#endif
125
126#if defined (SIGCONT)
127 sys_siglist[SIGCONT] = _("Continue");
128#endif
129
130#if !defined (SIGCHLD) && defined (SIGCLD)
131#define SIGCHLD SIGCLD
132#endif
133
134#if defined (SIGCHLD)
135 sys_siglist[SIGCHLD] = _("Child death or stop");
136#endif
137
138#if defined (SIGTTIN)
139 sys_siglist[SIGTTIN] = _("Stopped (tty input)");
140#endif
141
142#if defined (SIGTTOU)
143 sys_siglist[SIGTTOU] = _("Stopped (tty output)");
144#endif
145
146#if defined (SIGIO)
147 sys_siglist[SIGIO] = _("I/O ready");
148#endif
149
150#if defined (SIGXCPU)
151 sys_siglist[SIGXCPU] = _("CPU limit");
152#endif
153
154#if defined (SIGXFSZ)
155 sys_siglist[SIGXFSZ] = _("File limit");
156#endif
157
158#if defined (SIGVTALRM)
159 sys_siglist[SIGVTALRM] = _("Alarm (virtual)");
160#endif
161
162#if defined (SIGPROF)
163 sys_siglist[SIGPROF] = _("Alarm (profile)");
164#endif
165
166#if defined (SIGWINCH)
167 sys_siglist[SIGWINCH] = _("Window changed");
168#endif
169
170#if defined (SIGLOST)
171 sys_siglist[SIGLOST] = _("Record lock");
172#endif
173
174#if defined (SIGUSR1)
175 sys_siglist[SIGUSR1] = _("User signal 1");
176#endif
177
178#if defined (SIGUSR2)
179 sys_siglist[SIGUSR2] = _("User signal 2");
180#endif
181
182#if defined (SIGMSG)
183 sys_siglist[SIGMSG] = _("HFT input data pending");
184#endif
185
186#if defined (SIGPWR)
187 sys_siglist[SIGPWR] = _("power failure imminent");
188#endif
189
190#if defined (SIGDANGER)
191 sys_siglist[SIGDANGER] = _("system crash imminent");
192#endif
193
194#if defined (SIGMIGRATE)
195 sys_siglist[SIGMIGRATE] = _("migrate process to another CPU");
196#endif
197
198#if defined (SIGPRE)
199 sys_siglist[SIGPRE] = _("programming error");
200#endif
201
202#if defined (SIGGRANT)
203 sys_siglist[SIGGRANT] = _("HFT monitor mode granted");
204#endif
205
206#if defined (SIGRETRACT)
207 sys_siglist[SIGRETRACT] = _("HFT monitor mode retracted");
208#endif
209
210#if defined (SIGSOUND)
211 sys_siglist[SIGSOUND] = _("HFT sound sequence has completed");
212#endif
213
214#if defined (SIGINFO)
215 sys_siglist[SIGINFO] = _("Information request");
216#endif
217
218 for (i = 0; i < NSIG; i++)
219 {
220 if (!sys_siglist[i])
221 {
222 sys_siglist[i] =
223 (char *)xmalloc (10 + strlen (_("Unknown Signal #")));
224
225 sprintf (sys_siglist[i], _("Unknown Signal #%d"), i);
226 }
227 }
228}
229#endif /* !HAVE_SYS_SIGLIST && !HAVE_UNDER_SYS_SIGLIST && !HAVE_STRSIGNAL */