home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / socket / siglist.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-07  |  4.5 KB  |  223 lines

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