| 1 | /* siglist.c -- signal list for those machines that don't have one. */
|
|---|
| 2 |
|
|---|
| 3 | /* Copyright (C) 1989 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 it under
|
|---|
| 8 | the terms of the GNU General Public License as published by the Free
|
|---|
| 9 | Software Foundation; either version 2, or (at your option) any later
|
|---|
| 10 | version.
|
|---|
| 11 |
|
|---|
| 12 | Bash is distributed in the hope that it will be useful, but WITHOUT ANY
|
|---|
| 13 | WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|---|
| 14 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|---|
| 15 | for more details.
|
|---|
| 16 |
|
|---|
| 17 | You should have received a copy of the GNU General Public License along
|
|---|
| 18 | with Bash; see the file COPYING. If not, write to the Free Software
|
|---|
| 19 | Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
|
|---|
| 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 "xmalloc.h"
|
|---|
| 36 |
|
|---|
| 37 | char *sys_siglist[NSIG];
|
|---|
| 38 |
|
|---|
| 39 | void
|
|---|
| 40 | initialize_siglist ()
|
|---|
| 41 | {
|
|---|
| 42 | register int i;
|
|---|
| 43 |
|
|---|
| 44 | for (i = 0; i < NSIG; i++)
|
|---|
| 45 | sys_siglist[i] = (char *)0x0;
|
|---|
| 46 |
|
|---|
| 47 | sys_siglist[0] = "Bogus signal";
|
|---|
| 48 |
|
|---|
| 49 | #if defined (SIGHUP)
|
|---|
| 50 | sys_siglist[SIGHUP] = "Hangup";
|
|---|
| 51 | #endif
|
|---|
| 52 |
|
|---|
| 53 | #if defined (SIGINT)
|
|---|
| 54 | sys_siglist[SIGINT] = "Interrupt";
|
|---|
| 55 | #endif
|
|---|
| 56 |
|
|---|
| 57 | #if defined (SIGQUIT)
|
|---|
| 58 | sys_siglist[SIGQUIT] = "Quit";
|
|---|
| 59 | #endif
|
|---|
| 60 |
|
|---|
| 61 | #if defined (SIGILL)
|
|---|
| 62 | sys_siglist[SIGILL] = "Illegal instruction";
|
|---|
| 63 | #endif
|
|---|
| 64 |
|
|---|
| 65 | #if defined (SIGTRAP)
|
|---|
| 66 | sys_siglist[SIGTRAP] = "BPT trace/trap";
|
|---|
| 67 | #endif
|
|---|
| 68 |
|
|---|
| 69 | #if defined (SIGIOT) && !defined (SIGABRT)
|
|---|
| 70 | #define SIGABRT SIGIOT
|
|---|
| 71 | #endif
|
|---|
| 72 |
|
|---|
| 73 | #if defined (SIGABRT)
|
|---|
| 74 | sys_siglist[SIGABRT] = "ABORT instruction";
|
|---|
| 75 | #endif
|
|---|
| 76 |
|
|---|
| 77 | #if defined (SIGEMT)
|
|---|
| 78 | sys_siglist[SIGEMT] = "EMT instruction";
|
|---|
| 79 | #endif
|
|---|
| 80 |
|
|---|
| 81 | #if defined (SIGFPE)
|
|---|
| 82 | sys_siglist[SIGFPE] = "Floating point exception";
|
|---|
| 83 | #endif
|
|---|
| 84 |
|
|---|
| 85 | #if defined (SIGKILL)
|
|---|
| 86 | sys_siglist[SIGKILL] = "Killed";
|
|---|
| 87 | #endif
|
|---|
| 88 |
|
|---|
| 89 | #if defined (SIGBUS)
|
|---|
| 90 | sys_siglist[SIGBUS] = "Bus error";
|
|---|
| 91 | #endif
|
|---|
|
|---|