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