bash30-050-signames 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. --- /dev/null 2005-06-20 00:31:57.000000000 -0600
  2. +++ bash-3.0/signames.h 2005-08-02 16:57:21.000000000 -0600
  3. @@ -0,0 +1,202 @@
  4. +/* A translation list so we can be polite to our users. */
  5. +char *signal_names[NSIG + 4] = {
  6. + "EXIT",
  7. +#ifdef SIGHUP
  8. + [SIGHUP] "SIGHUP",
  9. +#endif
  10. +#ifdef SIGINT
  11. + [SIGINT] "SIGINT",
  12. +#endif
  13. +#ifdef SIGQUIT
  14. + [SIGQUIT] "SIGQUIT",
  15. +#endif
  16. +#ifdef SIGILL
  17. + [SIGILL] "SIGILL",
  18. +#endif
  19. +#ifdef SIGTRAP
  20. + [SIGTRAP] "SIGTRAP",
  21. +#endif
  22. +#ifdef SIGABRT
  23. + [SIGABRT] "SIGABRT",
  24. +#endif
  25. +#ifdef SIGBUS
  26. + [SIGBUS] "SIGBUS",
  27. +#endif
  28. +#ifdef SIGFPE
  29. + [SIGFPE] "SIGFPE",
  30. +#endif
  31. +#ifdef SIGKILL
  32. + [SIGKILL] "SIGKILL",
  33. +#endif
  34. +#ifdef SIGUSR1
  35. + [SIGUSR1] "SIGUSR1",
  36. +#endif
  37. +#ifdef SIGSEGV
  38. + [SIGSEGV] "SIGSEGV",
  39. +#endif
  40. +#ifdef SIGUSR2
  41. + [SIGUSR2] "SIGUSR2",
  42. +#endif
  43. +#ifdef SIGPIPE
  44. + [SIGPIPE] "SIGPIPE",
  45. +#endif
  46. +#ifdef SIGALRM
  47. + [SIGALRM] "SIGALRM",
  48. +#endif
  49. +#ifdef SIGTERM
  50. + [SIGTERM] "SIGTERM",
  51. +#endif
  52. +#ifdef SIGJUNK
  53. + [SIGJUNK] "SIGJUNK(16)",
  54. +#endif
  55. +#ifdef SIGCHLD
  56. + [SIGCHLD] "SIGCHLD",
  57. +#endif
  58. +#ifdef SIGCONT
  59. + [SIGCONT] "SIGCONT",
  60. +#endif
  61. +#ifdef SIGSTOP
  62. + [SIGSTOP] "SIGSTOP",
  63. +#endif
  64. +#ifdef SIGTSTP
  65. + [SIGTSTP] "SIGTSTP",
  66. +#endif
  67. +#ifdef SIGTTIN
  68. + [SIGTTIN] "SIGTTIN",
  69. +#endif
  70. +#ifdef SIGTTOU
  71. + [SIGTTOU] "SIGTTOU",
  72. +#endif
  73. +#ifdef SIGURG
  74. + [SIGURG] "SIGURG",
  75. +#endif
  76. +#ifdef SIGXCPU
  77. + [SIGXCPU] "SIGXCPU",
  78. +#endif
  79. +#ifdef SIGXFSZ
  80. + [SIGXFSZ] "SIGXFSZ",
  81. +#endif
  82. +#ifdef SIGVTALRM
  83. + [SIGVTALRM] "SIGVTALRM",
  84. +#endif
  85. +#ifdef SIGPROF
  86. + [SIGPROF] "SIGPROF",
  87. +#endif
  88. +#ifdef SIGWINCH
  89. + [SIGWINCH] "SIGWINCH",
  90. +#endif
  91. +#ifdef SIGIO
  92. + [SIGIO] "SIGIO",
  93. +#endif
  94. +#ifdef SIGPWR
  95. + [SIGPWR] "SIGPWR",
  96. +#endif
  97. +#ifdef SIGSYS
  98. + [SIGSYS] "SIGSYS",
  99. +#endif
  100. +#ifdef SIGJUNK
  101. + [SIGJUNK] "SIGJUNK(32)",
  102. +#endif
  103. +#ifdef SIGJUNK
  104. + [SIGJUNK] "SIGJUNK(33)",
  105. +#endif
  106. +#ifdef SIGJUNK
  107. + [SIGJUNK] "SIGJUNK(34)",
  108. +#endif
  109. +#ifdef SIGJUNK
  110. + [SIGJUNK] "SIGJUNK(35)",
  111. +#endif
  112. +#ifdef SIGJUNK
  113. + [SIGJUNK] "SIGJUNK(36)",
  114. +#endif
  115. +#ifdef SIGJUNK
  116. + [SIGJUNK] "SIGJUNK(37)",
  117. +#endif
  118. +#ifdef SIGJUNK
  119. + [SIGJUNK] "SIGJUNK(38)",
  120. +#endif
  121. +#ifdef SIGJUNK
  122. + [SIGJUNK] "SIGJUNK(39)",
  123. +#endif
  124. +#ifdef SIGJUNK
  125. + [SIGJUNK] "SIGJUNK(40)",
  126. +#endif
  127. +#ifdef SIGJUNK
  128. + [SIGJUNK] "SIGJUNK(41)",
  129. +#endif
  130. +#ifdef SIGJUNK
  131. + [SIGJUNK] "SIGJUNK(42)",
  132. +#endif
  133. +#ifdef SIGJUNK
  134. + [SIGJUNK] "SIGJUNK(43)",
  135. +#endif
  136. +#ifdef SIGJUNK
  137. + [SIGJUNK] "SIGJUNK(44)",
  138. +#endif
  139. +#ifdef SIGJUNK
  140. + [SIGJUNK] "SIGJUNK(45)",
  141. +#endif
  142. +#ifdef SIGJUNK
  143. + [SIGJUNK] "SIGJUNK(46)",
  144. +#endif
  145. +#ifdef SIGJUNK
  146. + [SIGJUNK] "SIGJUNK(47)",
  147. +#endif
  148. +#ifdef SIGJUNK
  149. + [SIGJUNK] "SIGJUNK(48)",
  150. +#endif
  151. +#ifdef SIGJUNK
  152. + [SIGJUNK] "SIGJUNK(49)",
  153. +#endif
  154. +#ifdef SIGJUNK
  155. + [SIGJUNK] "SIGJUNK(50)",
  156. +#endif
  157. +#ifdef SIGJUNK
  158. + [SIGJUNK] "SIGJUNK(51)",
  159. +#endif
  160. +#ifdef SIGJUNK
  161. + [SIGJUNK] "SIGJUNK(52)",
  162. +#endif
  163. +#ifdef SIGJUNK
  164. + [SIGJUNK] "SIGJUNK(53)",
  165. +#endif
  166. +#ifdef SIGJUNK
  167. + [SIGJUNK] "SIGJUNK(54)",
  168. +#endif
  169. +#ifdef SIGJUNK
  170. + [SIGJUNK] "SIGJUNK(55)",
  171. +#endif
  172. +#ifdef SIGJUNK
  173. + [SIGJUNK] "SIGJUNK(56)",
  174. +#endif
  175. +#ifdef SIGJUNK
  176. + [SIGJUNK] "SIGJUNK(57)",
  177. +#endif
  178. +#ifdef SIGJUNK
  179. + [SIGJUNK] "SIGJUNK(58)",
  180. +#endif
  181. +#ifdef SIGJUNK
  182. + [SIGJUNK] "SIGJUNK(59)",
  183. +#endif
  184. +#ifdef SIGJUNK
  185. + [SIGJUNK] "SIGJUNK(60)",
  186. +#endif
  187. +#ifdef SIGJUNK
  188. + [SIGJUNK] "SIGJUNK(61)",
  189. +#endif
  190. +#ifdef SIGJUNK
  191. + [SIGJUNK] "SIGJUNK(62)",
  192. +#endif
  193. +#ifdef SIGJUNK
  194. + [SIGJUNK] "SIGJUNK(63)",
  195. +#endif
  196. +#ifdef SIGJUNK
  197. + [SIGJUNK] "SIGJUNK(64)",
  198. +#endif
  199. + [NSIG] "DEBUG",
  200. +
  201. + [NSIG + 1] "ERR",
  202. +
  203. + [NSIG + 2] (char *)0x0
  204. +};
  205. +
  206. --- bash-3.0.orig/Makefile.in 2004-03-17 06:34:39.000000000 -0700
  207. +++ bash-3.0/Makefile.in 2005-08-02 16:44:29.000000000 -0600
  208. @@ -410,9 +410,6 @@
  209. SOURCES = $(CSOURCES) $(HSOURCES) $(BUILTIN_DEFS)
  210. -# header files chosen based on running of configure
  211. -SIGNAMES_H = @SIGNAMES_H@
  212. -
  213. # object files chosen based on running of configure
  214. JOBS_O = @JOBS_O@
  215. SIGLIST_O = @SIGLIST_O@
  216. @@ -483,15 +480,12 @@
  217. PO_SRC = $(srcdir)/po/
  218. PO_DIR = $(dot)/po/
  219. -SIGNAMES_SUPPORT = $(SUPPORT_SRC)mksignames.c
  220. -
  221. SUPPORT_SRC = $(srcdir)/support/
  222. SDIR = $(dot)/support/
  223. TESTS_SUPPORT = recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT)
  224. CREATED_SUPPORT = signames.h recho$(EXEEXT) zecho$(EXEEXT) printenv$(EXEEXT) \
  225. - tests/recho$(EXEEXT) tests/zecho$(EXEEXT) \
  226. - tests/printenv$(EXEEXT) mksignames$(EXEEXT) lsignames.h \
  227. + tests/recho$(EXEEXT) tests/zecho$(EXEEXT) tests/printenv$(EXEEXT) \
  228. mksyntax${EXEEXT} syntax.c $(VERSPROG) $(VERSOBJ) \
  229. buildversion.o
  230. CREATED_CONFIGURE = config.h config.cache config.status config.log \
  231. @@ -607,22 +601,9 @@
  232. ${LIBINTL_H}: ${INTL_LIBRARY}
  233. -mksignames$(EXEEXT): $(SUPPORT_SRC)mksignames.c
  234. - $(CC_FOR_BUILD) $(CCFLAGS_FOR_BUILD) -o $@ $(SUPPORT_SRC)mksignames.c
  235. -
  236. mksyntax$(EXEEXT): ${srcdir}/mksyntax.c config.h syntax.h ${BASHINCDIR}/chartypes.h
  237. ${CC_FOR_BUILD} ${CCFLAGS_FOR_BUILD} -o $@ ${srcdir}/mksyntax.c
  238. -# make a list of signals for the local system -- this is done when we're
  239. -# *not* cross-compiling
  240. -lsignames.h: mksignames$(EXEEXT)
  241. - $(RM) $@
  242. - ./mksignames $@
  243. -
  244. -# copy the correct signames header file to signames.h
  245. -signames.h: $(SIGNAMES_H)
  246. - -if cmp -s $(SIGNAMES_H) $@ ; then :; else $(RM) $@ ; $(CP) $(SIGNAMES_H) $@ ; fi
  247. -
  248. syntax.c: mksyntax${EXEEXT} $(srcdir)/syntax.h
  249. $(RM) $@
  250. ./mksyntax -o $@
  251. --- bash-3.0.orig/support/mksignames.c 2003-03-24 15:11:38.000000000 -0700
  252. +++ bash-3.0/support/mksignames.c 2005-06-20 00:31:57.000000000 -0600
  253. @@ -1,432 +0,0 @@
  254. -/* signames.c -- Create and write `signames.h', which contains an array of
  255. - signal names. */
  256. -
  257. -/* Copyright (C) 1992-2003 Free Software Foundation, Inc.
  258. -
  259. - This file is part of GNU Bash, the Bourne Again SHell.
  260. -
  261. - Bash is free software; you can redistribute it and/or modify it under
  262. - the terms of the GNU General Public License as published by the Free
  263. - Software Foundation; either version 2, or (at your option) any later
  264. - version.
  265. -
  266. - Bash is distributed in the hope that it will be useful, but WITHOUT ANY
  267. - WARRANTY; without even the implied warranty of MERCHANTABILITY or
  268. - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  269. - for more details.
  270. -
  271. - You should have received a copy of the GNU General Public License along
  272. - with Bash; see the file COPYING. If not, write to the Free Software
  273. - Foundation, 59 Temple Place, Suite 330, Boston, MA 02111 USA. */
  274. -
  275. -#include <config.h>
  276. -
  277. -#include <stdio.h>
  278. -#include <sys/types.h>
  279. -#include <signal.h>
  280. -#if defined (HAVE_STDLIB_H)
  281. -# include <stdlib.h>
  282. -#else
  283. -# include "ansi_stdlib.h"
  284. -#endif /* HAVE_STDLIB_H */
  285. -
  286. -#if !defined (NSIG)
  287. -# define NSIG 64
  288. -#endif
  289. -
  290. -/*
  291. - * Special traps:
  292. - * EXIT == 0
  293. - * DEBUG == NSIG
  294. - * ERR == NSIG+1
  295. - * RETURN == NSIG+2
  296. - */
  297. -#define LASTSIG NSIG+2
  298. -
  299. -char *signal_names[2 * (LASTSIG)];
  300. -
  301. -#define signal_names_size (sizeof(signal_names)/sizeof(signal_names[0]))
  302. -
  303. -char *progname;
  304. -
  305. -/* AIX 4.3 defines SIGRTMIN and SIGRTMAX as 888 and 999 respectively.
  306. - I don't want to allocate so much unused space for the intervening signal
  307. - numbers, so we just punt if SIGRTMAX is past the bounds of the
  308. - signal_names array (handled in configure). */
  309. -#if defined (SIGRTMAX) && defined (UNUSABLE_RT_SIGNALS)
  310. -# undef SIGRTMAX
  311. -# undef SIGRTMIN
  312. -#endif
  313. -
  314. -#if defined (SIGRTMAX) || defined (SIGRTMIN)
  315. -# define RTLEN 14
  316. -# define RTLIM 256
  317. -#endif
  318. -
  319. -void
  320. -initialize_signames ()
  321. -{
  322. - register int i;
  323. -#if defined (SIGRTMAX) || defined (SIGRTMIN)
  324. - int rtmin, rtmax, rtcnt;
  325. -#endif
  326. -
  327. - for (i = 1; i < signal_names_size; i++)
  328. - signal_names[i] = (char *)NULL;
  329. -
  330. - /* `signal' 0 is what we do on exit. */
  331. - signal_names[0] = "EXIT";
  332. -
  333. - /* Place signal names which can be aliases for more common signal
  334. - names first. This allows (for example) SIGABRT to overwrite SIGLOST. */
  335. -
  336. - /* POSIX 1003.1b-1993 real time signals, but take care of incomplete
  337. - implementations. Acoording to the standard, both, SIGRTMIN and
  338. - SIGRTMAX must be defined, SIGRTMIN must be stricly less than
  339. - SIGRTMAX, and the difference must be at least 7, that is, there
  340. - must be at least eight distinct real time signals. */
  341. -
  342. - /* The generated signal names are SIGRTMIN, SIGRTMIN+1, ...,
  343. - SIGRTMIN+x, SIGRTMAX-x, ..., SIGRTMAX-1, SIGRTMAX. If the number
  344. - of RT signals is odd, there is an extra SIGRTMIN+(x+1).
  345. - These names are the ones used by ksh and /usr/xpg4/bin/sh on SunOS5. */
  346. -
  347. -#if defined (SIGRTMIN)
  348. - rtmin = SIGRTMIN;
  349. - signal_names[rtmin] = "SIGRTMIN";
  350. -#endif
  351. -
  352. -#if defined (SIGRTMAX)
  353. - rtmax = SIGRTMAX;
  354. - signal_names[rtmax] = "SIGRTMAX";
  355. -#endif
  356. -
  357. -#if defined (SIGRTMAX) && defined (SIGRTMIN)
  358. - if (rtmax > rtmin)
  359. - {
  360. - rtcnt = (rtmax - rtmin - 1) / 2;
  361. - /* croak if there are too many RT signals */
  362. - if (rtcnt >= RTLIM/2)
  363. - {
  364. - rtcnt = RTLIM/2-1;
  365. - fprintf(stderr, "%s: error: more than %i real time signals, fix `%s'\n",
  366. - progname, RTLIM, progname);
  367. - }
  368. -
  369. - for (i = 1; i <= rtcnt; i++)
  370. - {
  371. - signal_names[rtmin+i] = (char *)malloc(RTLEN);
  372. - if (signal_names[rtmin+i])
  373. - sprintf (signal_names[rtmin+i], "SIGRTMIN+%d", i);
  374. - signal_names[rtmax-i] = (char *)malloc(RTLEN);
  375. - if (signal_names[rtmax-i])
  376. - sprintf (signal_names[rtmax-i], "SIGRTMAX-%d", i);
  377. - }
  378. -
  379. - if (rtcnt < RTLIM/2-1 && rtcnt != (rtmax-rtmin)/2)
  380. - {
  381. - /* Need an extra RTMIN signal */
  382. - signal_names[rtmin+rtcnt+1] = (char *)malloc(RTLEN);
  383. - if (signal_names[rtmin+rtcnt+1])
  384. - sprintf (signal_names[rtmin+rtcnt+1], "SIGRTMIN+%d", rtcnt+1);
  385. - }
  386. - }
  387. -#endif /* SIGRTMIN && SIGRTMAX */
  388. -
  389. -/* AIX */
  390. -#if defined (SIGLOST) /* resource lost (eg, record-lock lost) */
  391. - signal_names[SIGLOST] = "SIGLOST";
  392. -#endif
  393. -
  394. -#if defined (SIGMSG) /* HFT input data pending */
  395. - signal_names[SIGMSG] = "SIGMSG";
  396. -#endif
  397. -
  398. -#if defined (SIGDANGER) /* system crash imminent */
  399. - signal_names[SIGDANGER] = "SIGDANGER";
  400. -#endif
  401. -
  402. -#if defined (SIGMIGRATE) /* migrate process to another CPU */
  403. - signal_names[SIGMIGRATE] = "SIGMIGRATE";
  404. -#endif
  405. -
  406. -#if defined (SIGPRE) /* programming error */
  407. - signal_names[SIGPRE] = "SIGPRE";
  408. -#endif
  409. -
  410. -#if defined (SIGVIRT) /* AIX virtual time alarm */
  411. - signal_names[SIGVIRT] = "SIGVIRT";
  412. -#endif
  413. -
  414. -#if defined (SIGALRM1) /* m:n condition variables */
  415. - signal_names[SIGALRM1] = "SIGALRM1";
  416. -#endif
  417. -
  418. -#if defined (SIGWAITING) /* m:n scheduling */
  419. - signal_names[SIGWAITING] = "SIGWAITING";
  420. -#endif
  421. -
  422. -#if defined (SIGGRANT) /* HFT monitor mode granted */
  423. - signal_names[SIGGRANT] = "SIGGRANT";
  424. -#endif
  425. -
  426. -#if defined (SIGKAP) /* keep alive poll from native keyboard */
  427. - signal_names[SIGKAP] = "SIGKAP";
  428. -#endif
  429. -
  430. -#if defined (SIGRETRACT) /* HFT monitor mode retracted */
  431. - signal_names[SIGRETRACT] = "SIGRETRACT";
  432. -#endif
  433. -
  434. -#if defined (SIGSOUND) /* HFT sound sequence has completed */
  435. - signal_names[SIGSOUND] = "SIGSOUND";
  436. -#endif
  437. -
  438. -#if defined (SIGSAK) /* Secure Attention Key */
  439. - signal_names[SIGSAK] = "SIGSAK";
  440. -#endif
  441. -
  442. -/* SunOS5 */
  443. -#if defined (SIGLWP) /* special signal used by thread library */
  444. - signal_names[SIGLWP] = "SIGLWP";
  445. -#endif
  446. -
  447. -#if defined (SIGFREEZE) /* special signal used by CPR */
  448. - signal_names[SIGFREEZE] = "SIGFREEZE";
  449. -#endif
  450. -
  451. -#if defined (SIGTHAW) /* special signal used by CPR */
  452. - signal_names[SIGTHAW] = "SIGTHAW";
  453. -#endif
  454. -
  455. -#if defined (SIGCANCEL) /* thread cancellation signal used by libthread */
  456. - signal_names[SIGCANCEL] = "SIGCANCEL";
  457. -#endif
  458. -
  459. -/* HP-UX */
  460. -#if defined (SIGDIL) /* DIL signal (?) */
  461. - signal_names[SIGDIL] = "SIGDIL";
  462. -#endif
  463. -
  464. -/* System V */
  465. -#if defined (SIGCLD) /* Like SIGCHLD. */
  466. - signal_names[SIGCLD] = "SIGCLD";
  467. -#endif
  468. -
  469. -#if defined (SIGPWR) /* power state indication */
  470. - signal_names[SIGPWR] = "SIGPWR";
  471. -#endif
  472. -
  473. -#if defined (SIGPOLL) /* Pollable event (for streams) */
  474. - signal_names[SIGPOLL] = "SIGPOLL";
  475. -#endif
  476. -
  477. -/* Unknown */
  478. -#if defined (SIGWINDOW)
  479. - signal_names[SIGWINDOW] = "SIGWINDOW";
  480. -#endif
  481. -
  482. -/* Common */
  483. -#if defined (SIGHUP) /* hangup */
  484. - signal_names[SIGHUP] = "SIGHUP";
  485. -#endif
  486. -
  487. -#if defined (SIGINT) /* interrupt */
  488. - signal_names[SIGINT] = "SIGINT";
  489. -#endif
  490. -
  491. -#if defined (SIGQUIT) /* quit */
  492. - signal_names[SIGQUIT] = "SIGQUIT";
  493. -#endif
  494. -
  495. -#if defined (SIGILL) /* illegal instruction (not reset when caught) */
  496. - signal_names[SIGILL] = "SIGILL";
  497. -#endif
  498. -
  499. -#if defined (SIGTRAP) /* trace trap (not reset when caught) */
  500. - signal_names[SIGTRAP] = "SIGTRAP";
  501. -#endif
  502. -
  503. -#if defined (SIGIOT) /* IOT instruction */
  504. - signal_names[SIGIOT] = "SIGIOT";
  505. -#endif
  506. -
  507. -#if defined (SIGABRT) /* Cause current process to dump core. */
  508. - signal_names[SIGABRT] = "SIGABRT";
  509. -#endif
  510. -
  511. -#if defined (SIGEMT) /* EMT instruction */
  512. - signal_names[SIGEMT] = "SIGEMT";
  513. -#endif
  514. -
  515. -#if defined (SIGFPE) /* floating point exception */
  516. - signal_names[SIGFPE] = "SIGFPE";
  517. -#endif
  518. -
  519. -#if defined (SIGKILL) /* kill (cannot be caught or ignored) */
  520. - signal_names[SIGKILL] = "SIGKILL";
  521. -#endif
  522. -
  523. -#if defined (SIGBUS) /* bus error */
  524. - signal_names[SIGBUS] = "SIGBUS";
  525. -#endif
  526. -
  527. -#if defined (SIGSEGV) /* segmentation violation */
  528. - signal_names[SIGSEGV] = "SIGSEGV";
  529. -#endif
  530. -
  531. -#if defined (SIGSYS) /* bad argument to system call */
  532. - signal_names[SIGSYS] = "SIGSYS";
  533. -#endif
  534. -
  535. -#if defined (SIGPIPE) /* write on a pipe with no one to read it */
  536. - signal_names[SIGPIPE] = "SIGPIPE";
  537. -#endif
  538. -
  539. -#if defined (SIGALRM) /* alarm clock */
  540. - signal_names[SIGALRM] = "SIGALRM";
  541. -#endif
  542. -
  543. -#if defined (SIGTERM) /* software termination signal from kill */
  544. - signal_names[SIGTERM] = "SIGTERM";
  545. -#endif
  546. -
  547. -#if defined (SIGURG) /* urgent condition on IO channel */
  548. - signal_names[SIGURG] = "SIGURG";
  549. -#endif
  550. -
  551. -#if defined (SIGSTOP) /* sendable stop signal not from tty */
  552. - signal_names[SIGSTOP] = "SIGSTOP";
  553. -#endif
  554. -
  555. -#if defined (SIGTSTP) /* stop signal from tty */
  556. - signal_names[SIGTSTP] = "SIGTSTP";
  557. -#endif
  558. -
  559. -#if defined (SIGCONT) /* continue a stopped process */
  560. - signal_names[SIGCONT] = "SIGCONT";
  561. -#endif
  562. -
  563. -#if defined (SIGCHLD) /* to parent on child stop or exit */
  564. - signal_names[SIGCHLD] = "SIGCHLD";
  565. -#endif
  566. -
  567. -#if defined (SIGTTIN) /* to readers pgrp upon background tty read */
  568. - signal_names[SIGTTIN] = "SIGTTIN";
  569. -#endif
  570. -
  571. -#if defined (SIGTTOU) /* like TTIN for output if (tp->t_local&LTOSTOP) */
  572. - signal_names[SIGTTOU] = "SIGTTOU";
  573. -#endif
  574. -
  575. -#if defined (SIGIO) /* input/output possible signal */
  576. - signal_names[SIGIO] = "SIGIO";
  577. -#endif
  578. -
  579. -#if defined (SIGXCPU) /* exceeded CPU time limit */
  580. - signal_names[SIGXCPU] = "SIGXCPU";
  581. -#endif
  582. -
  583. -#if defined (SIGXFSZ) /* exceeded file size limit */
  584. - signal_names[SIGXFSZ] = "SIGXFSZ";
  585. -#endif
  586. -
  587. -#if defined (SIGVTALRM) /* virtual time alarm */
  588. - signal_names[SIGVTALRM] = "SIGVTALRM";
  589. -#endif
  590. -
  591. -#if defined (SIGPROF) /* profiling time alarm */
  592. - signal_names[SIGPROF] = "SIGPROF";
  593. -#endif
  594. -
  595. -#if defined (SIGWINCH) /* window changed */
  596. - signal_names[SIGWINCH] = "SIGWINCH";
  597. -#endif
  598. -
  599. -/* 4.4 BSD */
  600. -#if defined (SIGINFO) && !defined (_SEQUENT_) /* information request */
  601. - signal_names[SIGINFO] = "SIGINFO";
  602. -#endif
  603. -
  604. -#if defined (SIGUSR1) /* user defined signal 1 */
  605. - signal_names[SIGUSR1] = "SIGUSR1";
  606. -#endif
  607. -
  608. -#if defined (SIGUSR2) /* user defined signal 2 */
  609. - signal_names[SIGUSR2] = "SIGUSR2";
  610. -#endif
  611. -
  612. -#if defined (SIGKILLTHR) /* BeOS: Kill Thread */
  613. - signal_names[SIGKILLTHR] = "SIGKILLTHR";
  614. -#endif
  615. -
  616. - for (i = 0; i < NSIG; i++)
  617. - if (signal_names[i] == (char *)NULL)
  618. - {
  619. - signal_names[i] = (char *)malloc (18);
  620. - if (signal_names[i])
  621. - sprintf (signal_names[i], "SIGJUNK(%d)", i);
  622. - }
  623. -
  624. - signal_names[NSIG] = "DEBUG";
  625. - signal_names[NSIG+1] = "ERR";
  626. - signal_names[NSIG+2] = "RETURN";
  627. -}
  628. -
  629. -void
  630. -write_signames (stream)
  631. - FILE *stream;
  632. -{
  633. - register int i;
  634. -
  635. - fprintf (stream, "/* This file was automatically created by %s.\n",
  636. - progname);
  637. - fprintf (stream, " Do not edit. Edit support/mksignames.c instead. */\n\n");
  638. - fprintf (stream,
  639. - "/* A translation list so we can be polite to our users. */\n");
  640. - fprintf (stream, "char *signal_names[NSIG + 4] = {\n");
  641. -
  642. - for (i = 0; i <= LASTSIG; i++)
  643. - fprintf (stream, " \"%s\",\n", signal_names[i]);
  644. -
  645. - fprintf (stream, " (char *)0x0\n");
  646. - fprintf (stream, "};\n");
  647. -}
  648. -
  649. -int
  650. -main (argc, argv)
  651. - int argc;
  652. - char **argv;
  653. -{
  654. - char *stream_name;
  655. - FILE *stream;
  656. -
  657. - progname = argv[0];
  658. -
  659. - if (argc == 1)
  660. - {
  661. - stream_name = "stdout";
  662. - stream = stdout;
  663. - }
  664. - else if (argc == 2)
  665. - {
  666. - stream_name = argv[1];
  667. - stream = fopen (stream_name, "w");
  668. - }
  669. - else
  670. - {
  671. - fprintf (stderr, "Usage: %s [output-file]\n", progname);
  672. - exit (1);
  673. - }
  674. -
  675. - if (!stream)
  676. - {
  677. - fprintf (stderr, "%s: %s: cannot open for writing\n",
  678. - progname, stream_name);
  679. - exit (2);
  680. - }
  681. -
  682. - initialize_signames ();
  683. - write_signames (stream);
  684. - exit (0);
  685. -}