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