1 #include <signal.h>
2 #include <unistd.h>
3
4
5 /* Signal handlers, we set breakpoints in them to make sure that the
6 signals really get delivered. */
7
8 void
handle_ABRT(int sig)9 handle_ABRT (int sig)
10 {
11 }
12
13 void
handle_HUP(int sig)14 handle_HUP (int sig)
15 {
16 }
17
18 void
handle_QUIT(int sig)19 handle_QUIT (int sig)
20 {
21 }
22
23 void
handle_ILL(int sig)24 handle_ILL (int sig)
25 {
26 }
27
28 void
handle_EMT(int sig)29 handle_EMT (int sig)
30 {
31 }
32
33 void
handle_FPE(int sig)34 handle_FPE (int sig)
35 {
36 }
37
38 void
handle_BUS(int sig)39 handle_BUS (int sig)
40 {
41 }
42
43 void
handle_SEGV(int sig)44 handle_SEGV (int sig)
45 {
46 }
47
48 void
handle_SYS(int sig)49 handle_SYS (int sig)
50 {
51 }
52
53 void
handle_PIPE(int sig)54 handle_PIPE (int sig)
55 {
56 }
57
58 void
handle_ALRM(int sig)59 handle_ALRM (int sig)
60 {
61 }
62
63 void
handle_URG(int sig)64 handle_URG (int sig)
65 {
66 }
67
68 void
handle_TSTP(int sig)69 handle_TSTP (int sig)
70 {
71 }
72
73 void
handle_CONT(int sig)74 handle_CONT (int sig)
75 {
76 }
77
78 void
handle_CHLD(int sig)79 handle_CHLD (int sig)
80 {
81 }
82
83 void
handle_TTIN(int sig)84 handle_TTIN (int sig)
85 {
86 }
87
88 void
handle_TTOU(int sig)89 handle_TTOU (int sig)
90 {
91 }
92
93 void
handle_IO(int sig)94 handle_IO (int sig)
95 {
96 }
97
98 void
handle_XCPU(int sig)99 handle_XCPU (int sig)
100 {
101 }
102
103 void
handle_XFSZ(int sig)104 handle_XFSZ (int sig)
105 {
106 }
107
108 void
handle_VTALRM(int sig)109 handle_VTALRM (int sig)
110 {
111 }
112
113 void
handle_PROF(int sig)114 handle_PROF (int sig)
115 {
116 }
117
118 void
handle_WINCH(int sig)119 handle_WINCH (int sig)
120 {
121 }
122
123 void
handle_LOST(int sig)124 handle_LOST (int sig)
125 {
126 }
127
128 void
handle_USR1(int sig)129 handle_USR1 (int sig)
130 {
131 }
132
133 void
handle_USR2(int sig)134 handle_USR2 (int sig)
135 {
136 }
137
138 void
handle_PWR(int sig)139 handle_PWR (int sig)
140 {
141 }
142
143 void
handle_POLL(int sig)144 handle_POLL (int sig)
145 {
146 }
147
148 void
handle_WIND(int sig)149 handle_WIND (int sig)
150 {
151 }
152
153 void
handle_PHONE(int sig)154 handle_PHONE (int sig)
155 {
156 }
157
158 void
handle_WAITING(int sig)159 handle_WAITING (int sig)
160 {
161 }
162
163 void
handle_LWP(int sig)164 handle_LWP (int sig)
165 {
166 }
167
168 void
handle_DANGER(int sig)169 handle_DANGER (int sig)
170 {
171 }
172
173 void
handle_GRANT(int sig)174 handle_GRANT (int sig)
175 {
176 }
177
178 void
handle_RETRACT(int sig)179 handle_RETRACT (int sig)
180 {
181 }
182
183 void
handle_MSG(int sig)184 handle_MSG (int sig)
185 {
186 }
187
188 void
handle_SOUND(int sig)189 handle_SOUND (int sig)
190 {
191 }
192
193 void
handle_SAK(int sig)194 handle_SAK (int sig)
195 {
196 }
197
198 void
handle_PRIO(int sig)199 handle_PRIO (int sig)
200 {
201 }
202
203 void
handle_33(int sig)204 handle_33 (int sig)
205 {
206 }
207
208 void
handle_34(int sig)209 handle_34 (int sig)
210 {
211 }
212
213 void
handle_35(int sig)214 handle_35 (int sig)
215 {
216 }
217
218 void
handle_36(int sig)219 handle_36 (int sig)
220 {
221 }
222
223 void
handle_37(int sig)224 handle_37 (int sig)
225 {
226 }
227
228 void
handle_38(int sig)229 handle_38 (int sig)
230 {
231 }
232
233 void
handle_39(int sig)234 handle_39 (int sig)
235 {
236 }
237
238 void
handle_40(int sig)239 handle_40 (int sig)
240 {
241 }
242
243 void
handle_41(int sig)244 handle_41 (int sig)
245 {
246 }
247
248 void
handle_42(int sig)249 handle_42 (int sig)
250 {
251 }
252
253 void
handle_43(int sig)254 handle_43 (int sig)
255 {
256 }
257
258 void
handle_44(int sig)259 handle_44 (int sig)
260 {
261 }
262
263 void
handle_45(int sig)264 handle_45 (int sig)
265 {
266 }
267
268 void
handle_46(int sig)269 handle_46 (int sig)
270 {
271 }
272
273 void
handle_47(int sig)274 handle_47 (int sig)
275 {
276 }
277
278 void
handle_48(int sig)279 handle_48 (int sig)
280 {
281 }
282
283 void
handle_49(int sig)284 handle_49 (int sig)
285 {
286 }
287
288 void
handle_50(int sig)289 handle_50 (int sig)
290 {
291 }
292
293 void
handle_51(int sig)294 handle_51 (int sig)
295 {
296 }
297
298 void
handle_52(int sig)299 handle_52 (int sig)
300 {
301 }
302
303 void
handle_53(int sig)304 handle_53 (int sig)
305 {
306 }
307
308 void
handle_54(int sig)309 handle_54 (int sig)
310 {
311 }
312
313 void
handle_55(int sig)314 handle_55 (int sig)
315 {
316 }
317
318 void
handle_56(int sig)319 handle_56 (int sig)
320 {
321 }
322
323 void
handle_57(int sig)324 handle_57 (int sig)
325 {
326 }
327
328 void
handle_58(int sig)329 handle_58 (int sig)
330 {
331 }
332
333 void
handle_59(int sig)334 handle_59 (int sig)
335 {
336 }
337
338 void
handle_60(int sig)339 handle_60 (int sig)
340 {
341 }
342
343 void
handle_61(int sig)344 handle_61 (int sig)
345 {
346 }
347
348 void
handle_62(int sig)349 handle_62 (int sig)
350 {
351 }
352
353 void
handle_63(int sig)354 handle_63 (int sig)
355 {
356 }
357
358 void
handle_TERM(int sig)359 handle_TERM (int sig)
360 {
361 }
362
363 /* Functions to send signals. These also serve as markers.
364 Ordered ANSI-standard signals first, other signals second,
365 with signals in each block ordered by their numerical values
366 on a typical POSIX platform. */
367
368 /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
369 are ANSI-standard signals and are always available. */
370
371 int
gen_ILL()372 gen_ILL ()
373 {
374 kill (getpid (), SIGILL);
375 return 0;
376 }
377
378 int
gen_ABRT()379 gen_ABRT ()
380 {
381 kill (getpid (), SIGABRT);
382 return 0;
383 }
384
385 int x;
386
387 int
gen_FPE()388 gen_FPE ()
389 {
390 /* The intent behind generating SIGFPE this way is to check the mapping
391 from the CPU exception itself to the signals. It would be nice to
392 do the same for SIGBUS, SIGSEGV, etc., but I suspect that even this
393 test might turn out to be insufficiently portable. */
394
395 #if 0
396 /* Loses on the PA because after the signal handler executes we try to
397 re-execute the failing instruction again. Perhaps we could siglongjmp
398 out of the signal handler? */
399 /* The expect script looks for the word "kill"; don't delete it. */
400 return 5 / x; /* and we both started jumping up and down yelling kill */
401 #else
402 kill (getpid (), SIGFPE);
403 #endif
404 return 0;
405 }
406
407 int
gen_SEGV()408 gen_SEGV ()
409 {
410 kill (getpid (), SIGSEGV);
411 return 0;
412 }
413
414 int
gen_TERM()415 gen_TERM ()
416 {
417 kill (getpid (), SIGTERM);
418 return 0;
419 }
420
421 /* All other signals need preprocessor conditionals. */
422
423 int
gen_HUP()424 gen_HUP ()
425 {
426 #ifdef SIGHUP
427 kill (getpid (), SIGHUP);
428 #else
429 handle_HUP (0);
430 #endif
431 return 0;
432 }
433
434 int
gen_QUIT()435 gen_QUIT ()
436 {
437 #ifdef SIGQUIT
438 kill (getpid (), SIGQUIT);
439 #else
440 handle_QUIT (0);
441 #endif
442 return 0;
443 }
444
445 int
gen_EMT()446 gen_EMT ()
447 {
448 #ifdef SIGEMT
449 kill (getpid (), SIGEMT);
450 #else
451 handle_EMT (0);
452 #endif
453 return 0;
454 }
455
456 int
gen_BUS()457 gen_BUS ()
458 {
459 #ifdef SIGBUS
460 kill (getpid (), SIGBUS);
461 #else
462 handle_BUS (0);
463 #endif
464 return 0;
465 }
466
467 int
gen_SYS()468 gen_SYS ()
469 {
470 #ifdef SIGSYS
471 kill (getpid (), SIGSYS);
472 #else
473 handle_SYS (0);
474 #endif
475 return 0;
476 }
477
478 int
gen_PIPE()479 gen_PIPE ()
480 {
481 #ifdef SIGPIPE
482 kill (getpid (), SIGPIPE);
483 #else
484 handle_PIPE (0);
485 #endif
486 return 0;
487 }
488
489 int
gen_ALRM()490 gen_ALRM ()
491 {
492 #ifdef SIGALRM
493 kill (getpid (), SIGALRM);
494 #else
495 handle_ALRM (0);
496 #endif
497 return 0;
498 }
499
500 int
gen_URG()501 gen_URG ()
502 {
503 #ifdef SIGURG
504 kill (getpid (), SIGURG);
505 #else
506 handle_URG (0);
507 #endif
508 return 0;
509 }
510
511 int
gen_TSTP()512 gen_TSTP ()
513 {
514 #ifdef SIGTSTP
515 kill (getpid (), SIGTSTP);
516 #else
517 handle_TSTP (0);
518 #endif
519 return 0;
520 }
521
522 int
gen_CONT()523 gen_CONT ()
524 {
525 #ifdef SIGCONT
526 kill (getpid (), SIGCONT);
527 #else
528 handle_CONT (0);
529 #endif
530 return 0;
531 }
532
533 int
gen_CHLD()534 gen_CHLD ()
535 {
536 #ifdef SIGCHLD
537 kill (getpid (), SIGCHLD);
538 #else
539 handle_CHLD (0);
540 #endif
541 return 0;
542 }
543
544 int
gen_TTIN()545 gen_TTIN ()
546 {
547 #ifdef SIGTTIN
548 kill (getpid (), SIGTTIN);
549 #else
550 handle_TTIN (0);
551 #endif
552 return 0;
553 }
554
555 int
gen_TTOU()556 gen_TTOU ()
557 {
558 #ifdef SIGTTOU
559 kill (getpid (), SIGTTOU);
560 #else
561 handle_TTOU (0);
562 #endif
563 return 0;
564 }
565
566 int
gen_IO()567 gen_IO ()
568 {
569 #ifdef SIGIO
570 kill (getpid (), SIGIO);
571 #else
572 handle_IO (0);
573 #endif
574 return 0;
575 }
576
577 int
gen_XCPU()578 gen_XCPU ()
579 {
580 #ifdef SIGXCPU
581 kill (getpid (), SIGXCPU);
582 #else
583 handle_XCPU (0);
584 #endif
585 return 0;
586 }
587
588 int
gen_XFSZ()589 gen_XFSZ ()
590 {
591 #ifdef SIGXFSZ
592 kill (getpid (), SIGXFSZ);
593 #else
594 handle_XFSZ (0);
595 #endif
596 return 0;
597 }
598
599 int
gen_VTALRM()600 gen_VTALRM ()
601 {
602 #ifdef SIGVTALRM
603 kill (getpid (), SIGVTALRM);
604 #else
605 handle_VTALRM (0);
606 #endif
607 return 0;
608 }
609
610 int
gen_PROF()611 gen_PROF ()
612 {
613 #ifdef SIGPROF
614 kill (getpid (), SIGPROF);
615 #else
616 handle_PROF (0);
617 #endif
618 return 0;
619 }
620
621 int
gen_WINCH()622 gen_WINCH ()
623 {
624 #ifdef SIGWINCH
625 kill (getpid (), SIGWINCH);
626 #else
627 handle_WINCH (0);
628 #endif
629 return 0;
630 }
631
632 int
gen_LOST()633 gen_LOST ()
634 {
635 #if defined(SIGLOST) && SIGLOST != SIGABRT
636 kill (getpid (), SIGLOST);
637 #else
638 handle_LOST (0);
639 #endif
640 return 0;
641 }
642
643 int
gen_USR1()644 gen_USR1 ()
645 {
646 #ifdef SIGUSR1
647 kill (getpid (), SIGUSR1);
648 #else
649 handle_USR1 (0);
650 #endif
651 return 0;
652 }
653
654 int
gen_USR2()655 gen_USR2 ()
656 {
657 #ifdef SIGUSR2
658 kill (getpid (), SIGUSR2);
659 #else
660 handle_USR2 (0);
661 #endif
662 return 0;
663 }
664
665 int
gen_PWR()666 gen_PWR ()
667 {
668 #if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
669 kill (getpid (), SIGPWR);
670 #else
671 handle_PWR (0);
672 #endif
673 return 0;
674 }
675
676 int
gen_POLL()677 gen_POLL ()
678 {
679 #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
680 kill (getpid (), SIGPOLL);
681 #else
682 handle_POLL (0);
683 #endif
684 return 0;
685 }
686
687 int
gen_WIND()688 gen_WIND ()
689 {
690 #ifdef SIGWIND
691 kill (getpid (), SIGWIND);
692 #else
693 handle_WIND (0);
694 #endif
695 return 0;
696 }
697
698 int
gen_PHONE()699 gen_PHONE ()
700 {
701 #ifdef SIGPHONE
702 kill (getpid (), SIGPHONE);
703 #else
704 handle_PHONE (0);
705 #endif
706 return 0;
707 }
708
709 int
gen_WAITING()710 gen_WAITING ()
711 {
712 #ifdef SIGWAITING
713 kill (getpid (), SIGWAITING);
714 #else
715 handle_WAITING (0);
716 #endif
717 return 0;
718 }
719
720 int
gen_LWP()721 gen_LWP ()
722 {
723 #ifdef SIGLWP
724 kill (getpid (), SIGLWP);
725 #else
726 handle_LWP (0);
727 #endif
728 return 0;
729 }
730
731 int
gen_DANGER()732 gen_DANGER ()
733 {
734 #ifdef SIGDANGER
735 kill (getpid (), SIGDANGER);
736 #else
737 handle_DANGER (0);
738 #endif
739 return 0;
740 }
741
742 int
gen_GRANT()743 gen_GRANT ()
744 {
745 #ifdef SIGGRANT
746 kill (getpid (), SIGGRANT);
747 #else
748 handle_GRANT (0);
749 #endif
750 return 0;
751 }
752
753 int
gen_RETRACT()754 gen_RETRACT ()
755 {
756 #ifdef SIGRETRACT
757 kill (getpid (), SIGRETRACT);
758 #else
759 handle_RETRACT (0);
760 #endif
761 return 0;
762 }
763
764 int
gen_MSG()765 gen_MSG ()
766 {
767 #ifdef SIGMSG
768 kill (getpid (), SIGMSG);
769 #else
770 handle_MSG (0);
771 #endif
772 return 0;
773 }
774
775 int
gen_SOUND()776 gen_SOUND ()
777 {
778 #ifdef SIGSOUND
779 kill (getpid (), SIGSOUND);
780 #else
781 handle_SOUND (0);
782 #endif
783 return 0;
784 }
785
786 int
gen_SAK()787 gen_SAK ()
788 {
789 #ifdef SIGSAK
790 kill (getpid (), SIGSAK);
791 #else
792 handle_SAK (0);
793 #endif
794 return 0;
795 }
796
797 int
gen_PRIO()798 gen_PRIO ()
799 {
800 #ifdef SIGPRIO
801 kill (getpid (), SIGPRIO);
802 #else
803 handle_PRIO (0);
804 #endif
805 return 0;
806 }
807
808 int
gen_33()809 gen_33 ()
810 {
811 #ifdef SIG33
812 kill (getpid (), 33);
813 #else
814 handle_33 (0);
815 #endif
816 return 0;
817 }
818
819 int
gen_34()820 gen_34 ()
821 {
822 #ifdef SIG34
823 kill (getpid (), 34);
824 #else
825 handle_34 (0);
826 #endif
827 return 0;
828 }
829
830 int
gen_35()831 gen_35 ()
832 {
833 #ifdef SIG35
834 kill (getpid (), 35);
835 #else
836 handle_35 (0);
837 #endif
838 return 0;
839 }
840
841 int
gen_36()842 gen_36 ()
843 {
844 #ifdef SIG36
845 kill (getpid (), 36);
846 #else
847 handle_36 (0);
848 #endif
849 return 0;
850 }
851
852 int
gen_37()853 gen_37 ()
854 {
855 #ifdef SIG37
856 kill (getpid (), 37);
857 #else
858 handle_37 (0);
859 #endif
860 return 0;
861 }
862
863 int
gen_38()864 gen_38 ()
865 {
866 #ifdef SIG38
867 kill (getpid (), 38);
868 #else
869 handle_38 (0);
870 #endif
871 return 0;
872 }
873
874 int
gen_39()875 gen_39 ()
876 {
877 #ifdef SIG39
878 kill (getpid (), 39);
879 #else
880 handle_39 (0);
881 #endif
882 return 0;
883 }
884
885 int
gen_40()886 gen_40 ()
887 {
888 #ifdef SIG40
889 kill (getpid (), 40);
890 #else
891 handle_40 (0);
892 #endif
893 return 0;
894 }
895
896 int
gen_41()897 gen_41 ()
898 {
899 #ifdef SIG41
900 kill (getpid (), 41);
901 #else
902 handle_41 (0);
903 #endif
904 return 0;
905 }
906
907 int
gen_42()908 gen_42 ()
909 {
910 #ifdef SIG42
911 kill (getpid (), 42);
912 #else
913 handle_42 (0);
914 #endif
915 return 0;
916 }
917
918 int
gen_43()919 gen_43 ()
920 {
921 #ifdef SIG43
922 kill (getpid (), 43);
923 #else
924 handle_43 (0);
925 #endif
926 return 0;
927 }
928
929 int
gen_44()930 gen_44 ()
931 {
932 #ifdef SIG44
933 kill (getpid (), 44);
934 #else
935 handle_44 (0);
936 #endif
937 return 0;
938 }
939
940 int
gen_45()941 gen_45 ()
942 {
943 #ifdef SIG45
944 kill (getpid (), 45);
945 #else
946 handle_45 (0);
947 #endif
948 return 0;
949 }
950
951 int
gen_46()952 gen_46 ()
953 {
954 #ifdef SIG46
955 kill (getpid (), 46);
956 #else
957 handle_46 (0);
958 #endif
959 return 0;
960 }
961
962 int
gen_47()963 gen_47 ()
964 {
965 #ifdef SIG47
966 kill (getpid (), 47);
967 #else
968 handle_47 (0);
969 #endif
970 return 0;
971 }
972
973 int
gen_48()974 gen_48 ()
975 {
976 #ifdef SIG48
977 kill (getpid (), 48);
978 #else
979 handle_48 (0);
980 #endif
981 return 0;
982 }
983
984 int
gen_49()985 gen_49 ()
986 {
987 #ifdef SIG49
988 kill (getpid (), 49);
989 #else
990 handle_49 (0);
991 #endif
992 return 0;
993 }
994
995 int
gen_50()996 gen_50 ()
997 {
998 #ifdef SIG50
999 kill (getpid (), 50);
1000 #else
1001 handle_50 (0);
1002 #endif
1003 return 0;
1004 }
1005
1006 int
gen_51()1007 gen_51 ()
1008 {
1009 #ifdef SIG51
1010 kill (getpid (), 51);
1011 #else
1012 handle_51 (0);
1013 #endif
1014 return 0;
1015 }
1016
1017 int
gen_52()1018 gen_52 ()
1019 {
1020 #ifdef SIG52
1021 kill (getpid (), 52);
1022 #else
1023 handle_52 (0);
1024 #endif
1025 return 0;
1026 }
1027
1028 int
gen_53()1029 gen_53 ()
1030 {
1031 #ifdef SIG53
1032 kill (getpid (), 53);
1033 #else
1034 handle_53 (0);
1035 #endif
1036 return 0;
1037 }
1038
1039 int
gen_54()1040 gen_54 ()
1041 {
1042 #ifdef SIG54
1043 kill (getpid (), 54);
1044 #else
1045 handle_54 (0);
1046 #endif
1047 return 0;
1048 }
1049
1050 int
gen_55()1051 gen_55 ()
1052 {
1053 #ifdef SIG55
1054 kill (getpid (), 55);
1055 #else
1056 handle_55 (0);
1057 #endif
1058 return 0;
1059 }
1060
1061 int
gen_56()1062 gen_56 ()
1063 {
1064 #ifdef SIG56
1065 kill (getpid (), 56);
1066 #else
1067 handle_56 (0);
1068 #endif
1069 return 0;
1070 }
1071
1072 int
gen_57()1073 gen_57 ()
1074 {
1075 #ifdef SIG57
1076 kill (getpid (), 57);
1077 #else
1078 handle_57 (0);
1079 #endif
1080 return 0;
1081 }
1082
1083 int
gen_58()1084 gen_58 ()
1085 {
1086 #ifdef SIG58
1087 kill (getpid (), 58);
1088 #else
1089 handle_58 (0);
1090 #endif
1091 return 0;
1092 }
1093
1094 int
gen_59()1095 gen_59 ()
1096 {
1097 #ifdef SIG59
1098 kill (getpid (), 59);
1099 #else
1100 handle_59 (0);
1101 #endif
1102 return 0;
1103 }
1104
1105 int
gen_60()1106 gen_60 ()
1107 {
1108 #ifdef SIG60
1109 kill (getpid (), 60);
1110 #else
1111 handle_60 (0);
1112 #endif
1113 return 0;
1114 }
1115
1116 int
gen_61()1117 gen_61 ()
1118 {
1119 #ifdef SIG61
1120 kill (getpid (), 61);
1121 #else
1122 handle_61 (0);
1123 #endif
1124 return 0;
1125 }
1126
1127 int
gen_62()1128 gen_62 ()
1129 {
1130 #ifdef SIG62
1131 kill (getpid (), 62);
1132 #else
1133 handle_62 (0);
1134 #endif
1135 return 0;
1136 }
1137
1138 int
gen_63()1139 gen_63 ()
1140 {
1141 #ifdef SIG63
1142 kill (getpid (), 63);
1143 #else
1144 handle_63 (0);
1145 #endif
1146 return 0;
1147 }
1148
1149 int
main()1150 main ()
1151 {
1152
1153 #ifdef SIG_SETMASK
1154 /* Ensure all the signals aren't blocked.
1155 The environment in which the testsuite is run may have blocked some
1156 for whatever reason. */
1157 {
1158 sigset_t newset;
1159 sigemptyset (&newset);
1160 sigprocmask (SIG_SETMASK, &newset, NULL);
1161 }
1162 #endif
1163
1164 /* Signals are ordered ANSI-standard signals first, other signals
1165 second, with signals in each block ordered by their numerical
1166 values on a typical POSIX platform. */
1167
1168 /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM
1169 are ANSI-standard signals and are always available. */
1170 signal (SIGILL, handle_ILL);
1171 signal (SIGABRT, handle_ABRT);
1172 signal (SIGFPE, handle_FPE);
1173 signal (SIGSEGV, handle_SEGV);
1174 signal (SIGTERM, handle_TERM);
1175
1176 /* All other signals need preprocessor conditionals. */
1177 #ifdef SIGHUP
1178 signal (SIGHUP, handle_HUP);
1179 #endif
1180 #ifdef SIGQUIT
1181 signal (SIGQUIT, handle_QUIT);
1182 #endif
1183 #ifdef SIGEMT
1184 signal (SIGEMT, handle_EMT);
1185 #endif
1186 #ifdef SIGBUS
1187 signal (SIGBUS, handle_BUS);
1188 #endif
1189 #ifdef SIGSYS
1190 signal (SIGSYS, handle_SYS);
1191 #endif
1192 #ifdef SIGPIPE
1193 signal (SIGPIPE, handle_PIPE);
1194 #endif
1195 #ifdef SIGALRM
1196 signal (SIGALRM, handle_ALRM);
1197 #endif
1198 #ifdef SIGURG
1199 signal (SIGURG, handle_URG);
1200 #endif
1201 #ifdef SIGTSTP
1202 signal (SIGTSTP, handle_TSTP);
1203 #endif
1204 #ifdef SIGCONT
1205 signal (SIGCONT, handle_CONT);
1206 #endif
1207 #ifdef SIGCHLD
1208 signal (SIGCHLD, handle_CHLD);
1209 #endif
1210 #ifdef SIGTTIN
1211 signal (SIGTTIN, handle_TTIN);
1212 #endif
1213 #ifdef SIGTTOU
1214 signal (SIGTTOU, handle_TTOU);
1215 #endif
1216 #ifdef SIGIO
1217 signal (SIGIO, handle_IO);
1218 #endif
1219 #ifdef SIGXCPU
1220 signal (SIGXCPU, handle_XCPU);
1221 #endif
1222 #ifdef SIGXFSZ
1223 signal (SIGXFSZ, handle_XFSZ);
1224 #endif
1225 #ifdef SIGVTALRM
1226 signal (SIGVTALRM, handle_VTALRM);
1227 #endif
1228 #ifdef SIGPROF
1229 signal (SIGPROF, handle_PROF);
1230 #endif
1231 #ifdef SIGWINCH
1232 signal (SIGWINCH, handle_WINCH);
1233 #endif
1234 #if defined(SIGLOST) && SIGLOST != SIGABRT
1235 signal (SIGLOST, handle_LOST);
1236 #endif
1237 #ifdef SIGUSR1
1238 signal (SIGUSR1, handle_USR1);
1239 #endif
1240 #ifdef SIGUSR2
1241 signal (SIGUSR2, handle_USR2);
1242 #endif
1243 #if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
1244 signal (SIGPWR, handle_PWR);
1245 #endif
1246 #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
1247 signal (SIGPOLL, handle_POLL);
1248 #endif
1249 #ifdef SIGWIND
1250 signal (SIGWIND, handle_WIND);
1251 #endif
1252 #ifdef SIGPHONE
1253 signal (SIGPHONE, handle_PHONE);
1254 #endif
1255 #ifdef SIGWAITING
1256 signal (SIGWAITING, handle_WAITING);
1257 #endif
1258 #ifdef SIGLWP
1259 signal (SIGLWP, handle_LWP);
1260 #endif
1261 #ifdef SIGDANGER
1262 signal (SIGDANGER, handle_DANGER);
1263 #endif
1264 #ifdef SIGGRANT
1265 signal (SIGGRANT, handle_GRANT);
1266 #endif
1267 #ifdef SIGRETRACT
1268 signal (SIGRETRACT, handle_RETRACT);
1269 #endif
1270 #ifdef SIGMSG
1271 signal (SIGMSG, handle_MSG);
1272 #endif
1273 #ifdef SIGSOUND
1274 signal (SIGSOUND, handle_SOUND);
1275 #endif
1276 #ifdef SIGSAK
1277 signal (SIGSAK, handle_SAK);
1278 #endif
1279 #ifdef SIGPRIO
1280 signal (SIGPRIO, handle_PRIO);
1281 #endif
1282 #ifdef __Lynx__
1283 /* Lynx doesn't seem to have anything in signal.h for this. */
1284 signal (33, handle_33);
1285 signal (34, handle_34);
1286 signal (35, handle_35);
1287 signal (36, handle_36);
1288 signal (37, handle_37);
1289 signal (38, handle_38);
1290 signal (39, handle_39);
1291 signal (40, handle_40);
1292 signal (41, handle_41);
1293 signal (42, handle_42);
1294 signal (43, handle_43);
1295 signal (44, handle_44);
1296 signal (45, handle_45);
1297 signal (46, handle_46);
1298 signal (47, handle_47);
1299 signal (48, handle_48);
1300 signal (49, handle_49);
1301 signal (50, handle_50);
1302 signal (51, handle_51);
1303 signal (52, handle_52);
1304 signal (53, handle_53);
1305 signal (54, handle_54);
1306 signal (55, handle_55);
1307 signal (56, handle_56);
1308 signal (57, handle_57);
1309 signal (58, handle_58);
1310 signal (59, handle_59);
1311 signal (60, handle_60);
1312 signal (61, handle_61);
1313 signal (62, handle_62);
1314 signal (63, handle_63);
1315 #endif /* lynx */
1316
1317 x = 0;
1318
1319 gen_ABRT ();
1320 gen_HUP ();
1321 gen_QUIT ();
1322 gen_ILL ();
1323 gen_EMT ();
1324 gen_FPE ();
1325 gen_BUS ();
1326 gen_SEGV ();
1327 gen_SYS ();
1328 gen_PIPE ();
1329 gen_ALRM ();
1330 gen_URG ();
1331 gen_TSTP ();
1332 gen_CONT ();
1333 gen_CHLD ();
1334 gen_TTIN ();
1335 gen_TTOU ();
1336 gen_IO ();
1337 gen_XCPU ();
1338 gen_XFSZ ();
1339 gen_VTALRM ();
1340 gen_PROF ();
1341 gen_WINCH ();
1342 gen_LOST ();
1343 gen_USR1 ();
1344 gen_USR2 ();
1345 gen_PWR ();
1346 gen_POLL ();
1347 gen_WIND ();
1348 gen_PHONE ();
1349 gen_WAITING ();
1350 gen_LWP ();
1351 gen_DANGER ();
1352 gen_GRANT ();
1353 gen_RETRACT ();
1354 gen_MSG ();
1355 gen_SOUND ();
1356 gen_SAK ();
1357 gen_PRIO ();
1358 gen_33 ();
1359 gen_34 ();
1360 gen_35 ();
1361 gen_36 ();
1362 gen_37 ();
1363 gen_38 ();
1364 gen_39 ();
1365 gen_40 ();
1366 gen_41 ();
1367 gen_42 ();
1368 gen_43 ();
1369 gen_44 ();
1370 gen_45 ();
1371 gen_46 ();
1372 gen_47 ();
1373 gen_48 ();
1374 gen_49 ();
1375 gen_50 ();
1376 gen_51 ();
1377 gen_52 ();
1378 gen_53 ();
1379 gen_54 ();
1380 gen_55 ();
1381 gen_56 ();
1382 gen_57 ();
1383 gen_58 ();
1384 gen_59 ();
1385 gen_60 ();
1386 gen_61 ();
1387 gen_62 ();
1388 gen_63 ();
1389 gen_TERM ();
1390
1391 return 0;
1392 }
1393