i-bash/siglist.c

230 lines
4.7 KiB
C
Raw Permalink Normal View History

1996-08-26 18:22:31 +00:00
/* siglist.c -- signal list for those machines that don't have one. */
2009-01-12 13:36:28 +00:00
/* Copyright (C) 1989-2009 Free Software Foundation, Inc.
1996-08-26 18:22:31 +00:00
2009-01-12 13:36:28 +00:00
This file is part of GNU Bash, the Bourne Again SHell.
1996-08-26 18:22:31 +00:00
2009-01-12 13:36:28 +00:00
Bash is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
1996-08-26 18:22:31 +00:00
2009-01-12 13:36:28 +00:00
Bash is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
1996-08-26 18:22:31 +00:00
2009-01-12 13:36:28 +00:00
You should have received a copy of the GNU General Public License
along with Bash. If not, see <http://www.gnu.org/licenses/>.
*/
1996-08-26 18:22:31 +00:00
1996-12-23 17:02:34 +00:00
#include "config.h"
1997-09-22 20:22:27 +00:00
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_UNDER_SYS_SIGLIST) && !defined (HAVE_STRSIGNAL)
1996-12-23 17:02:34 +00:00
1996-08-26 18:22:31 +00:00
#include <stdio.h>
1997-06-05 14:59:13 +00:00
#include "bashtypes.h"
1996-08-26 18:22:31 +00:00
#include <signal.h>
#include "siglist.h"
#if !defined (NSIG)
# include "trap.h"
#endif
2011-11-21 20:51:19 -05:00
#include "bashintl.h"
2001-11-13 17:56:06 +00:00
#include "xmalloc.h"
1996-08-26 18:22:31 +00:00
2001-11-13 17:56:06 +00:00
char *sys_siglist[NSIG];
1996-08-26 18:22:31 +00:00
void
initialize_siglist ()
{
register int i;
for (i = 0; i < NSIG; i++)
sys_siglist[i] = (char *)0x0;
2009-01-12 13:36:28 +00:00
sys_siglist[0] = _("Bogus signal");
1996-08-26 18:22:31 +00:00
#if defined (SIGHUP)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGHUP] = _("Hangup");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGINT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGINT] = _("Interrupt");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGQUIT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGQUIT] = _("Quit");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGILL)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGILL] = _("Illegal instruction");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGTRAP)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGTRAP] = _("BPT trace/trap");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGIOT) && !defined (SIGABRT)
#define SIGABRT SIGIOT
#endif
#if defined (SIGABRT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGABRT] = _("ABORT instruction");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGEMT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGEMT] = _("EMT instruction");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGFPE)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGFPE] = _("Floating point exception");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGKILL)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGKILL] = _("Killed");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGBUS)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGBUS] = _("Bus error");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGSEGV)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGSEGV] = _("Segmentation fault");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGSYS)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGSYS] = _("Bad system call");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGPIPE)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGPIPE] = _("Broken pipe");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGALRM)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGALRM] = _("Alarm clock");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGTERM)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGTERM] = _("Terminated");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGURG)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGURG] = _("Urgent IO condition");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGSTOP)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGSTOP] = _("Stopped (signal)");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGTSTP)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGTSTP] = _("Stopped");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGCONT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGCONT] = _("Continue");
1996-08-26 18:22:31 +00:00
#endif
#if !defined (SIGCHLD) && defined (SIGCLD)
#define SIGCHLD SIGCLD
#endif
#if defined (SIGCHLD)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGCHLD] = _("Child death or stop");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGTTIN)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGTTIN] = _("Stopped (tty input)");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGTTOU)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGTTOU] = _("Stopped (tty output)");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGIO)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGIO] = _("I/O ready");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGXCPU)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGXCPU] = _("CPU limit");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGXFSZ)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGXFSZ] = _("File limit");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGVTALRM)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGVTALRM] = _("Alarm (virtual)");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGPROF)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGPROF] = _("Alarm (profile)");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGWINCH)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGWINCH] = _("Window changed");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGLOST)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGLOST] = _("Record lock");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGUSR1)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGUSR1] = _("User signal 1");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGUSR2)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGUSR2] = _("User signal 2");
1996-08-26 18:22:31 +00:00
#endif
#if defined (SIGMSG)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGMSG] = _("HFT input data pending");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGPWR)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGPWR] = _("power failure imminent");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGDANGER)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGDANGER] = _("system crash imminent");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGMIGRATE)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGMIGRATE] = _("migrate process to another CPU");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGPRE)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGPRE] = _("programming error");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGGRANT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGGRANT] = _("HFT monitor mode granted");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGRETRACT)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGRETRACT] = _("HFT monitor mode retracted");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
#if defined (SIGSOUND)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGSOUND] = _("HFT sound sequence has completed");
1996-12-23 17:02:34 +00:00
#endif
1996-08-26 18:22:31 +00:00
1997-06-05 14:59:13 +00:00
#if defined (SIGINFO)
2009-01-12 13:36:28 +00:00
sys_siglist[SIGINFO] = _("Information request");
1997-06-05 14:59:13 +00:00
#endif
1996-08-26 18:22:31 +00:00
for (i = 0; i < NSIG; i++)
{
if (!sys_siglist[i])
{
sys_siglist[i] =
2009-01-12 13:36:28 +00:00
(char *)xmalloc (10 + strlen (_("Unknown Signal #")));
1996-08-26 18:22:31 +00:00
2009-01-12 13:36:28 +00:00
sprintf (sys_siglist[i], _("Unknown Signal #%d"), i);
1996-08-26 18:22:31 +00:00
}
}
}
1997-09-22 20:22:27 +00:00
#endif /* !HAVE_SYS_SIGLIST && !HAVE_UNDER_SYS_SIGLIST && !HAVE_STRSIGNAL */