110029d8e283a8cabc9d76fa8ae08cf50bab2688
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / sigall.c
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 #ifdef PROTOTYPES
9 void
10 handle_ABRT (int sig)
11 #else
12 void
13 handle_ABRT (sig)
14 int sig;
15 #endif
16 {
17 }
18
19 #ifdef PROTOTYPES
20 void
21 handle_HUP (int sig)
22 #else
23 void
24 handle_HUP (sig)
25 int sig;
26 #endif
27 {
28 }
29
30 #ifdef PROTOTYPES
31 void
32 handle_QUIT (int sig)
33 #else
34 void
35 handle_QUIT (sig)
36 int sig;
37 #endif
38 {
39 }
40
41 #ifdef PROTOTYPES
42 void
43 handle_ILL (int sig)
44 #else
45 void
46 handle_ILL (sig)
47 int sig;
48 #endif
49 {
50 }
51
52 #ifdef PROTOTYPES
53 void
54 handle_EMT (int sig)
55 #else
56 void
57 handle_EMT (sig)
58 int sig;
59 #endif
60 {
61 }
62
63 #ifdef PROTOTYPES
64 void
65 handle_FPE (int sig)
66 #else
67 void
68 handle_FPE (sig)
69 int sig;
70 #endif
71 {
72 }
73
74 #ifdef PROTOTYPES
75 void
76 handle_BUS (int sig)
77 #else
78 void
79 handle_BUS (sig)
80 int sig;
81 #endif
82 {
83 }
84
85 #ifdef PROTOTYPES
86 void
87 handle_SEGV (int sig)
88 #else
89 void
90 handle_SEGV (sig)
91 int sig;
92 #endif
93 {
94 }
95
96 #ifdef PROTOTYPES
97 void
98 handle_SYS (int sig)
99 #else
100 void
101 handle_SYS (sig)
102 int sig;
103 #endif
104 {
105 }
106
107 #ifdef PROTOTYPES
108 void
109 handle_PIPE (int sig)
110 #else
111 void
112 handle_PIPE (sig)
113 int sig;
114 #endif
115 {
116 }
117
118 #ifdef PROTOTYPES
119 void
120 handle_ALRM (int sig)
121 #else
122 void
123 handle_ALRM (sig)
124 int sig;
125 #endif
126 {
127 }
128
129 #ifdef PROTOTYPES
130 void
131 handle_URG (int sig)
132 #else
133 void
134 handle_URG (sig)
135 int sig;
136 #endif
137 {
138 }
139
140 #ifdef PROTOTYPES
141 void
142 handle_TSTP (int sig)
143 #else
144 void
145 handle_TSTP (sig)
146 int sig;
147 #endif
148 {
149 }
150
151 #ifdef PROTOTYPES
152 void
153 handle_CONT (int sig)
154 #else
155 void
156 handle_CONT (sig)
157 int sig;
158 #endif
159 {
160 }
161
162 #ifdef PROTOTYPES
163 void
164 handle_CHLD (int sig)
165 #else
166 void
167 handle_CHLD (sig)
168 int sig;
169 #endif
170 {
171 }
172
173 #ifdef PROTOTYPES
174 void
175 handle_TTIN (int sig)
176 #else
177 void
178 handle_TTIN (sig)
179 int sig;
180 #endif
181 {
182 }
183
184 #ifdef PROTOTYPES
185 void
186 handle_TTOU (int sig)
187 #else
188 void
189 handle_TTOU (sig)
190 int sig;
191 #endif
192 {
193 }
194
195 #ifdef PROTOTYPES
196 void
197 handle_IO (int sig)
198 #else
199 void
200 handle_IO (sig)
201 int sig;
202 #endif
203 {
204 }
205
206 #ifdef PROTOTYPES
207 void
208 handle_XCPU (int sig)
209 #else
210 void
211 handle_XCPU (sig)
212 int sig;
213 #endif
214 {
215 }
216
217 #ifdef PROTOTYPES
218 void
219 handle_XFSZ (int sig)
220 #else
221 void
222 handle_XFSZ (sig)
223 int sig;
224 #endif
225 {
226 }
227
228 #ifdef PROTOTYPES
229 void
230 handle_VTALRM (int sig)
231 #else
232 void
233 handle_VTALRM (sig)
234 int sig;
235 #endif
236 {
237 }
238
239 #ifdef PROTOTYPES
240 void
241 handle_PROF (int sig)
242 #else
243 void
244 handle_PROF (sig)
245 int sig;
246 #endif
247 {
248 }
249
250 #ifdef PROTOTYPES
251 void
252 handle_WINCH (int sig)
253 #else
254 void
255 handle_WINCH (sig)
256 int sig;
257 #endif
258 {
259 }
260
261 #ifdef PROTOTYPES
262 void
263 handle_LOST (int sig)
264 #else
265 void
266 handle_LOST (sig)
267 int sig;
268 #endif
269 {
270 }
271
272 #ifdef PROTOTYPES
273 void
274 handle_USR1 (int sig)
275 #else
276 void
277 handle_USR1 (sig)
278 int sig;
279 #endif
280 {
281 }
282
283 #ifdef PROTOTYPES
284 void
285 handle_USR2 (int sig)
286 #else
287 void
288 handle_USR2 (sig)
289 int sig;
290 #endif
291 {
292 }
293
294 #ifdef PROTOTYPES
295 void
296 handle_PWR (int sig)
297 #else
298 void
299 handle_PWR (sig)
300 int sig;
301 #endif
302 {
303 }
304
305 #ifdef PROTOTYPES
306 void
307 handle_POLL (int sig)
308 #else
309 void
310 handle_POLL (sig)
311 int sig;
312 #endif
313 {
314 }
315
316 #ifdef PROTOTYPES
317 void
318 handle_WIND (int sig)
319 #else
320 void
321 handle_WIND (sig)
322 int sig;
323 #endif
324 {
325 }
326
327 #ifdef PROTOTYPES
328 void
329 handle_PHONE (int sig)
330 #else
331 void
332 handle_PHONE (sig)
333 int sig;
334 #endif
335 {
336 }
337
338 #ifdef PROTOTYPES
339 void
340 handle_WAITING (int sig)
341 #else
342 void
343 handle_WAITING (sig)
344 int sig;
345 #endif
346 {
347 }
348
349 #ifdef PROTOTYPES
350 void
351 handle_LWP (int sig)
352 #else
353 void
354 handle_LWP (sig)
355 int sig;
356 #endif
357 {
358 }
359
360 #ifdef PROTOTYPES
361 void
362 handle_DANGER (int sig)
363 #else
364 void
365 handle_DANGER (sig)
366 int sig;
367 #endif
368 {
369 }
370
371 #ifdef PROTOTYPES
372 void
373 handle_GRANT (int sig)
374 #else
375 void
376 handle_GRANT (sig)
377 int sig;
378 #endif
379 {
380 }
381
382 #ifdef PROTOTYPES
383 void
384 handle_RETRACT (int sig)
385 #else
386 void
387 handle_RETRACT (sig)
388 int sig;
389 #endif
390 {
391 }
392
393 #ifdef PROTOTYPES
394 void
395 handle_MSG (int sig)
396 #else
397 void
398 handle_MSG (sig)
399 int sig;
400 #endif
401 {
402 }
403
404 #ifdef PROTOTYPES
405 void
406 handle_SOUND (int sig)
407 #else
408 void
409 handle_SOUND (sig)
410 int sig;
411 #endif
412 {
413 }
414
415 #ifdef PROTOTYPES
416 void
417 handle_SAK (int sig)
418 #else
419 void
420 handle_SAK (sig)
421 int sig;
422 #endif
423 {
424 }
425
426 #ifdef PROTOTYPES
427 void
428 handle_PRIO (int sig)
429 #else
430 void
431 handle_PRIO (sig)
432 int sig;
433 #endif
434 {
435 }
436
437 #ifdef PROTOTYPES
438 void
439 handle_33 (int sig)
440 #else
441 void
442 handle_33 (sig)
443 int sig;
444 #endif
445 {
446 }
447
448 #ifdef PROTOTYPES
449 void
450 handle_34 (int sig)
451 #else
452 void
453 handle_34 (sig)
454 int sig;
455 #endif
456 {
457 }
458
459 #ifdef PROTOTYPES
460 void
461 handle_35 (int sig)
462 #else
463 void
464 handle_35 (sig)
465 int sig;
466 #endif
467 {
468 }
469
470 #ifdef PROTOTYPES
471 void
472 handle_36 (int sig)
473 #else
474 void
475 handle_36 (sig)
476 int sig;
477 #endif
478 {
479 }
480
481 #ifdef PROTOTYPES
482 void
483 handle_37 (int sig)
484 #else
485 void
486 handle_37 (sig)
487 int sig;
488 #endif
489 {
490 }
491
492 #ifdef PROTOTYPES
493 void
494 handle_38 (int sig)
495 #else
496 void
497 handle_38 (sig)
498 int sig;
499 #endif
500 {
501 }
502
503 #ifdef PROTOTYPES
504 void
505 handle_39 (int sig)
506 #else
507 void
508 handle_39 (sig)
509 int sig;
510 #endif
511 {
512 }
513
514 #ifdef PROTOTYPES
515 void
516 handle_40 (int sig)
517 #else
518 void
519 handle_40 (sig)
520 int sig;
521 #endif
522 {
523 }
524
525 #ifdef PROTOTYPES
526 void
527 handle_41 (int sig)
528 #else
529 void
530 handle_41 (sig)
531 int sig;
532 #endif
533 {
534 }
535
536 #ifdef PROTOTYPES
537 void
538 handle_42 (int sig)
539 #else
540 void
541 handle_42 (sig)
542 int sig;
543 #endif
544 {
545 }
546
547 #ifdef PROTOTYPES
548 void
549 handle_43 (int sig)
550 #else
551 void
552 handle_43 (sig)
553 int sig;
554 #endif
555 {
556 }
557
558 #ifdef PROTOTYPES
559 void
560 handle_44 (int sig)
561 #else
562 void
563 handle_44 (sig)
564 int sig;
565 #endif
566 {
567 }
568
569 #ifdef PROTOTYPES
570 void
571 handle_45 (int sig)
572 #else
573 void
574 handle_45 (sig)
575 int sig;
576 #endif
577 {
578 }
579
580 #ifdef PROTOTYPES
581 void
582 handle_46 (int sig)
583 #else
584 void
585 handle_46 (sig)
586 int sig;
587 #endif
588 {
589 }
590
591 #ifdef PROTOTYPES
592 void
593 handle_47 (int sig)
594 #else
595 void
596 handle_47 (sig)
597 int sig;
598 #endif
599 {
600 }
601
602 #ifdef PROTOTYPES
603 void
604 handle_48 (int sig)
605 #else
606 void
607 handle_48 (sig)
608 int sig;
609 #endif
610 {
611 }
612
613 #ifdef PROTOTYPES
614 void
615 handle_49 (int sig)
616 #else
617 void
618 handle_49 (sig)
619 int sig;
620 #endif
621 {
622 }
623
624 #ifdef PROTOTYPES
625 void
626 handle_50 (int sig)
627 #else
628 void
629 handle_50 (sig)
630 int sig;
631 #endif
632 {
633 }
634
635 #ifdef PROTOTYPES
636 void
637 handle_51 (int sig)
638 #else
639 void
640 handle_51 (sig)
641 int sig;
642 #endif
643 {
644 }
645
646 #ifdef PROTOTYPES
647 void
648 handle_52 (int sig)
649 #else
650 void
651 handle_52 (sig)
652 int sig;
653 #endif
654 {
655 }
656
657 #ifdef PROTOTYPES
658 void
659 handle_53 (int sig)
660 #else
661 void
662 handle_53 (sig)
663 int sig;
664 #endif
665 {
666 }
667
668 #ifdef PROTOTYPES
669 void
670 handle_54 (int sig)
671 #else
672 void
673 handle_54 (sig)
674 int sig;
675 #endif
676 {
677 }
678
679 #ifdef PROTOTYPES
680 void
681 handle_55 (int sig)
682 #else
683 void
684 handle_55 (sig)
685 int sig;
686 #endif
687 {
688 }
689
690 #ifdef PROTOTYPES
691 void
692 handle_56 (int sig)
693 #else
694 void
695 handle_56 (sig)
696 int sig;
697 #endif
698 {
699 }
700
701 #ifdef PROTOTYPES
702 void
703 handle_57 (int sig)
704 #else
705 void
706 handle_57 (sig)
707 int sig;
708 #endif
709 {
710 }
711
712 #ifdef PROTOTYPES
713 void
714 handle_58 (int sig)
715 #else
716 void
717 handle_58 (sig)
718 int sig;
719 #endif
720 {
721 }
722
723 #ifdef PROTOTYPES
724 void
725 handle_59 (int sig)
726 #else
727 void
728 handle_59 (sig)
729 int sig;
730 #endif
731 {
732 }
733
734 #ifdef PROTOTYPES
735 void
736 handle_60 (int sig)
737 #else
738 void
739 handle_60 (sig)
740 int sig;
741 #endif
742 {
743 }
744
745 #ifdef PROTOTYPES
746 void
747 handle_61 (int sig)
748 #else
749 void
750 handle_61 (sig)
751 int sig;
752 #endif
753 {
754 }
755
756 #ifdef PROTOTYPES
757 void
758 handle_62 (int sig)
759 #else
760 void
761 handle_62 (sig)
762 int sig;
763 #endif
764 {
765 }
766
767 #ifdef PROTOTYPES
768 void
769 handle_63 (int sig)
770 #else
771 void
772 handle_63 (sig)
773 int sig;
774 #endif
775 {
776 }
777
778 #ifdef PROTOTYPES
779 void
780 handle_TERM (int sig)
781 #else
782 void
783 handle_TERM (sig)
784 int sig;
785 #endif
786 {
787 }
788 \f
789 /* Functions to send signals. These also serve as markers. */
790 int
791 gen_ABRT ()
792 {
793 kill (getpid (), SIGABRT);
794 return 0;
795 }
796
797 int
798 gen_HUP ()
799 {
800 #ifdef SIGHUP
801 kill (getpid (), SIGHUP);
802 #else
803 handle_HUP (0);
804 #endif
805 return 0;
806 }
807
808 int
809 gen_QUIT ()
810 {
811 #ifdef SIGQUIT
812 kill (getpid (), SIGQUIT);
813 #else
814 handle_QUIT (0);
815 #endif
816 return 0;
817 }
818
819 int
820 gen_ILL ()
821 {
822 #ifdef SIGILL
823 kill (getpid (), SIGILL);
824 #else
825 handle_ILL (0);
826 #endif
827 return 0;
828 }
829
830 int
831 gen_EMT ()
832 {
833 #ifdef SIGEMT
834 kill (getpid (), SIGEMT);
835 #else
836 handle_EMT (0);
837 #endif
838 return 0;
839 }
840
841 int x;
842
843 int
844 gen_FPE ()
845 {
846 /* The intent behind generating SIGFPE this way is to check the mapping
847 from the CPU exception itself to the signals. It would be nice to
848 do the same for SIGBUS, SIGSEGV, etc., but I suspect that even this
849 test might turn out to be insufficiently portable. */
850
851 #if 0
852 /* Loses on the PA because after the signal handler executes we try to
853 re-execute the failing instruction again. Perhaps we could siglongjmp
854 out of the signal handler? */
855 /* The expect script looks for the word "kill"; don't delete it. */
856 return 5 / x; /* and we both started jumping up and down yelling kill */
857 #else
858 kill (getpid (), SIGFPE);
859 #endif
860 return 0;
861 }
862
863 int
864 gen_BUS ()
865 {
866 #ifdef SIGBUS
867 kill (getpid (), SIGBUS);
868 #else
869 handle_BUS (0);
870 #endif
871 return 0;
872 }
873
874 int
875 gen_SEGV ()
876 {
877 #ifdef SIGSEGV
878 kill (getpid (), SIGSEGV);
879 #else
880 handle_SEGV (0);
881 #endif
882 return 0;
883 }
884
885 int
886 gen_SYS ()
887 {
888 #ifdef SIGSYS
889 kill (getpid (), SIGSYS);
890 #else
891 handle_SYS (0);
892 #endif
893 return 0;
894 }
895
896 int
897 gen_PIPE ()
898 {
899 #ifdef SIGPIPE
900 kill (getpid (), SIGPIPE);
901 #else
902 handle_PIPE (0);
903 #endif
904 return 0;
905 }
906
907 int
908 gen_ALRM ()
909 {
910 #ifdef SIGALRM
911 kill (getpid (), SIGALRM);
912 #else
913 handle_ALRM (0);
914 #endif
915 return 0;
916 }
917
918 int
919 gen_URG ()
920 {
921 #ifdef SIGURG
922 kill (getpid (), SIGURG);
923 #else
924 handle_URG (0);
925 #endif
926 return 0;
927 }
928
929 int
930 gen_TSTP ()
931 {
932 #ifdef SIGTSTP
933 kill (getpid (), SIGTSTP);
934 #else
935 handle_TSTP (0);
936 #endif
937 return 0;
938 }
939
940 int
941 gen_CONT ()
942 {
943 #ifdef SIGCONT
944 kill (getpid (), SIGCONT);
945 #else
946 handle_CONT (0);
947 #endif
948 return 0;
949 }
950
951 int
952 gen_CHLD ()
953 {
954 #ifdef SIGCHLD
955 kill (getpid (), SIGCHLD);
956 #else
957 handle_CHLD (0);
958 #endif
959 return 0;
960 }
961
962 int
963 gen_TTIN ()
964 {
965 #ifdef SIGTTIN
966 kill (getpid (), SIGTTIN);
967 #else
968 handle_TTIN (0);
969 #endif
970 return 0;
971 }
972
973 int
974 gen_TTOU ()
975 {
976 #ifdef SIGTTOU
977 kill (getpid (), SIGTTOU);
978 #else
979 handle_TTOU (0);
980 #endif
981 return 0;
982 }
983
984 int
985 gen_IO ()
986 {
987 #ifdef SIGIO
988 kill (getpid (), SIGIO);
989 #else
990 handle_IO (0);
991 #endif
992 return 0;
993 }
994
995 int
996 gen_XCPU ()
997 {
998 #ifdef SIGXCPU
999 kill (getpid (), SIGXCPU);
1000 #else
1001 handle_XCPU (0);
1002 #endif
1003 return 0;
1004 }
1005
1006 int
1007 gen_XFSZ ()
1008 {
1009 #ifdef SIGXFSZ
1010 kill (getpid (), SIGXFSZ);
1011 #else
1012 handle_XFSZ (0);
1013 #endif
1014 return 0;
1015 }
1016
1017 int
1018 gen_VTALRM ()
1019 {
1020 #ifdef SIGVTALRM
1021 kill (getpid (), SIGVTALRM);
1022 #else
1023 handle_VTALRM (0);
1024 #endif
1025 return 0;
1026 }
1027
1028 int
1029 gen_PROF ()
1030 {
1031 #ifdef SIGPROF
1032 kill (getpid (), SIGPROF);
1033 #else
1034 handle_PROF (0);
1035 #endif
1036 return 0;
1037 }
1038
1039 int
1040 gen_WINCH ()
1041 {
1042 #ifdef SIGWINCH
1043 kill (getpid (), SIGWINCH);
1044 #else
1045 handle_WINCH (0);
1046 #endif
1047 return 0;
1048 }
1049
1050 int
1051 gen_LOST ()
1052 {
1053 #if defined(SIGLOST) && (!defined(SIGABRT) || SIGLOST != SIGABRT)
1054 kill (getpid (), SIGLOST);
1055 #else
1056 handle_LOST (0);
1057 #endif
1058 return 0;
1059 }
1060
1061 int
1062 gen_USR1 ()
1063 {
1064 #ifdef SIGUSR1
1065 kill (getpid (), SIGUSR1);
1066 #else
1067 handle_USR1 (0);
1068 #endif
1069 return 0;
1070 }
1071
1072 int
1073 gen_USR2 ()
1074 {
1075 #ifdef SIGUSR2
1076 kill (getpid (), SIGUSR2);
1077 #else
1078 handle_USR2 (0);
1079 #endif
1080 return 0;
1081 }
1082
1083 int
1084 gen_PWR ()
1085 {
1086 #ifdef SIGPWR
1087 kill (getpid (), SIGPWR);
1088 #else
1089 handle_PWR (0);
1090 #endif
1091 return 0;
1092 }
1093
1094 int
1095 gen_POLL ()
1096 {
1097 #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
1098 kill (getpid (), SIGPOLL);
1099 #else
1100 handle_POLL (0);
1101 #endif
1102 return 0;
1103 }
1104
1105 int
1106 gen_WIND ()
1107 {
1108 #ifdef SIGWIND
1109 kill (getpid (), SIGWIND);
1110 #else
1111 handle_WIND (0);
1112 #endif
1113 return 0;
1114 }
1115
1116 int
1117 gen_PHONE ()
1118 {
1119 #ifdef SIGPHONE
1120 kill (getpid (), SIGPHONE);
1121 #else
1122 handle_PHONE (0);
1123 #endif
1124 return 0;
1125 }
1126
1127 int
1128 gen_WAITING ()
1129 {
1130 #ifdef SIGWAITING
1131 kill (getpid (), SIGWAITING);
1132 #else
1133 handle_WAITING (0);
1134 #endif
1135 return 0;
1136 }
1137
1138 int
1139 gen_LWP ()
1140 {
1141 #ifdef SIGLWP
1142 kill (getpid (), SIGLWP);
1143 #else
1144 handle_LWP (0);
1145 #endif
1146 return 0;
1147 }
1148
1149 int
1150 gen_DANGER ()
1151 {
1152 #ifdef SIGDANGER
1153 kill (getpid (), SIGDANGER);
1154 #else
1155 handle_DANGER (0);
1156 #endif
1157 return 0;
1158 }
1159
1160 int
1161 gen_GRANT ()
1162 {
1163 #ifdef SIGGRANT
1164 kill (getpid (), SIGGRANT);
1165 #else
1166 handle_GRANT (0);
1167 #endif
1168 return 0;
1169 }
1170
1171 int
1172 gen_RETRACT ()
1173 {
1174 #ifdef SIGRETRACT
1175 kill (getpid (), SIGRETRACT);
1176 #else
1177 handle_RETRACT (0);
1178 #endif
1179 return 0;
1180 }
1181
1182 int
1183 gen_MSG ()
1184 {
1185 #ifdef SIGMSG
1186 kill (getpid (), SIGMSG);
1187 #else
1188 handle_MSG (0);
1189 #endif
1190 return 0;
1191 }
1192
1193 int
1194 gen_SOUND ()
1195 {
1196 #ifdef SIGSOUND
1197 kill (getpid (), SIGSOUND);
1198 #else
1199 handle_SOUND (0);
1200 #endif
1201 return 0;
1202 }
1203
1204 int
1205 gen_SAK ()
1206 {
1207 #ifdef SIGSAK
1208 kill (getpid (), SIGSAK);
1209 #else
1210 handle_SAK (0);
1211 #endif
1212 return 0;
1213 }
1214
1215 int
1216 gen_PRIO ()
1217 {
1218 #ifdef SIGPRIO
1219 kill (getpid (), SIGPRIO);
1220 #else
1221 handle_PRIO (0);
1222 #endif
1223 return 0;
1224 }
1225
1226 int
1227 gen_33 ()
1228 {
1229 #ifdef SIG33
1230 kill (getpid (), 33);
1231 #else
1232 handle_33 (0);
1233 #endif
1234 return 0;
1235 }
1236
1237 int
1238 gen_34 ()
1239 {
1240 #ifdef SIG34
1241 kill (getpid (), 34);
1242 #else
1243 handle_34 (0);
1244 #endif
1245 return 0;
1246 }
1247
1248 int
1249 gen_35 ()
1250 {
1251 #ifdef SIG35
1252 kill (getpid (), 35);
1253 #else
1254 handle_35 (0);
1255 #endif
1256 return 0;
1257 }
1258
1259 int
1260 gen_36 ()
1261 {
1262 #ifdef SIG36
1263 kill (getpid (), 36);
1264 #else
1265 handle_36 (0);
1266 #endif
1267 return 0;
1268 }
1269
1270 int
1271 gen_37 ()
1272 {
1273 #ifdef SIG37
1274 kill (getpid (), 37);
1275 #else
1276 handle_37 (0);
1277 #endif
1278 return 0;
1279 }
1280
1281 int
1282 gen_38 ()
1283 {
1284 #ifdef SIG38
1285 kill (getpid (), 38);
1286 #else
1287 handle_38 (0);
1288 #endif
1289 return 0;
1290 }
1291
1292 int
1293 gen_39 ()
1294 {
1295 #ifdef SIG39
1296 kill (getpid (), 39);
1297 #else
1298 handle_39 (0);
1299 #endif
1300 return 0;
1301 }
1302
1303 int
1304 gen_40 ()
1305 {
1306 #ifdef SIG40
1307 kill (getpid (), 40);
1308 #else
1309 handle_40 (0);
1310 #endif
1311 return 0;
1312 }
1313
1314 int
1315 gen_41 ()
1316 {
1317 #ifdef SIG41
1318 kill (getpid (), 41);
1319 #else
1320 handle_41 (0);
1321 #endif
1322 return 0;
1323 }
1324
1325 int
1326 gen_42 ()
1327 {
1328 #ifdef SIG42
1329 kill (getpid (), 42);
1330 #else
1331 handle_42 (0);
1332 #endif
1333 return 0;
1334 }
1335
1336 int
1337 gen_43 ()
1338 {
1339 #ifdef SIG43
1340 kill (getpid (), 43);
1341 #else
1342 handle_43 (0);
1343 #endif
1344 return 0;
1345 }
1346
1347 int
1348 gen_44 ()
1349 {
1350 #ifdef SIG44
1351 kill (getpid (), 44);
1352 #else
1353 handle_44 (0);
1354 #endif
1355 return 0;
1356 }
1357
1358 int
1359 gen_45 ()
1360 {
1361 #ifdef SIG45
1362 kill (getpid (), 45);
1363 #else
1364 handle_45 (0);
1365 #endif
1366 return 0;
1367 }
1368
1369 int
1370 gen_46 ()
1371 {
1372 #ifdef SIG46
1373 kill (getpid (), 46);
1374 #else
1375 handle_46 (0);
1376 #endif
1377 return 0;
1378 }
1379
1380 int
1381 gen_47 ()
1382 {
1383 #ifdef SIG47
1384 kill (getpid (), 47);
1385 #else
1386 handle_47 (0);
1387 #endif
1388 return 0;
1389 }
1390
1391 int
1392 gen_48 ()
1393 {
1394 #ifdef SIG48
1395 kill (getpid (), 48);
1396 #else
1397 handle_48 (0);
1398 #endif
1399 return 0;
1400 }
1401
1402 int
1403 gen_49 ()
1404 {
1405 #ifdef SIG49
1406 kill (getpid (), 49);
1407 #else
1408 handle_49 (0);
1409 #endif
1410 return 0;
1411 }
1412
1413 int
1414 gen_50 ()
1415 {
1416 #ifdef SIG50
1417 kill (getpid (), 50);
1418 #else
1419 handle_50 (0);
1420 #endif
1421 return 0;
1422 }
1423
1424 int
1425 gen_51 ()
1426 {
1427 #ifdef SIG51
1428 kill (getpid (), 51);
1429 #else
1430 handle_51 (0);
1431 #endif
1432 return 0;
1433 }
1434
1435 int
1436 gen_52 ()
1437 {
1438 #ifdef SIG52
1439 kill (getpid (), 52);
1440 #else
1441 handle_52 (0);
1442 #endif
1443 return 0;
1444 }
1445
1446 int
1447 gen_53 ()
1448 {
1449 #ifdef SIG53
1450 kill (getpid (), 53);
1451 #else
1452 handle_53 (0);
1453 #endif
1454 return 0;
1455 }
1456
1457 int
1458 gen_54 ()
1459 {
1460 #ifdef SIG54
1461 kill (getpid (), 54);
1462 #else
1463 handle_54 (0);
1464 #endif
1465 return 0;
1466 }
1467
1468 int
1469 gen_55 ()
1470 {
1471 #ifdef SIG55
1472 kill (getpid (), 55);
1473 #else
1474 handle_55 (0);
1475 #endif
1476 return 0;
1477 }
1478
1479 int
1480 gen_56 ()
1481 {
1482 #ifdef SIG56
1483 kill (getpid (), 56);
1484 #else
1485 handle_56 (0);
1486 #endif
1487 return 0;
1488 }
1489
1490 int
1491 gen_57 ()
1492 {
1493 #ifdef SIG57
1494 kill (getpid (), 57);
1495 #else
1496 handle_57 (0);
1497 #endif
1498 return 0;
1499 }
1500
1501 int
1502 gen_58 ()
1503 {
1504 #ifdef SIG58
1505 kill (getpid (), 58);
1506 #else
1507 handle_58 (0);
1508 #endif
1509 return 0;
1510 }
1511
1512 int
1513 gen_59 ()
1514 {
1515 #ifdef SIG59
1516 kill (getpid (), 59);
1517 #else
1518 handle_59 (0);
1519 #endif
1520 return 0;
1521 }
1522
1523 int
1524 gen_60 ()
1525 {
1526 #ifdef SIG60
1527 kill (getpid (), 60);
1528 #else
1529 handle_60 (0);
1530 #endif
1531 return 0;
1532 }
1533
1534 int
1535 gen_61 ()
1536 {
1537 #ifdef SIG61
1538 kill (getpid (), 61);
1539 #else
1540 handle_61 (0);
1541 #endif
1542 return 0;
1543 }
1544
1545 int
1546 gen_62 ()
1547 {
1548 #ifdef SIG62
1549 kill (getpid (), 62);
1550 #else
1551 handle_62 (0);
1552 #endif
1553 return 0;
1554 }
1555
1556 int
1557 gen_63 ()
1558 {
1559 #ifdef SIG63
1560 kill (getpid (), 63);
1561 #else
1562 handle_63 (0);
1563 #endif
1564 return 0;
1565 }
1566
1567 int
1568 gen_TERM ()
1569 {
1570 kill (getpid (), SIGTERM);
1571 return 0;
1572 }
1573 \f
1574 int
1575 main ()
1576 {
1577
1578 #ifdef SIG_SETMASK
1579 /* Ensure all the signals aren't blocked.
1580 The environment in which the testsuite is run may have blocked some
1581 for whatever reason. */
1582 {
1583 sigset_t newset;
1584 sigemptyset (&newset);
1585 sigprocmask (SIG_SETMASK, &newset, NULL);
1586 }
1587 #endif
1588
1589 signal (SIGABRT, handle_ABRT);
1590 #ifdef SIGHUP
1591 signal (SIGHUP, handle_HUP);
1592 #endif
1593 #ifdef SIGQUIT
1594 signal (SIGQUIT, handle_QUIT);
1595 #endif
1596 #ifdef SIGILL
1597 signal (SIGILL, handle_ILL);
1598 #endif
1599 #ifdef SIGEMT
1600 signal (SIGEMT, handle_EMT);
1601 #endif
1602 #ifdef SIGFPE
1603 signal (SIGFPE, handle_FPE);
1604 #endif
1605 #ifdef SIGBUS
1606 signal (SIGBUS, handle_BUS);
1607 #endif
1608 #ifdef SIGSEGV
1609 signal (SIGSEGV, handle_SEGV);
1610 #endif
1611 #ifdef SIGSYS
1612 signal (SIGSYS, handle_SYS);
1613 #endif
1614 #ifdef SIGPIPE
1615 signal (SIGPIPE, handle_PIPE);
1616 #endif
1617 #ifdef SIGALRM
1618 signal (SIGALRM, handle_ALRM);
1619 #endif
1620 #ifdef SIGURG
1621 signal (SIGURG, handle_URG);
1622 #endif
1623 #ifdef SIGTSTP
1624 signal (SIGTSTP, handle_TSTP);
1625 #endif
1626 #ifdef SIGCONT
1627 signal (SIGCONT, handle_CONT);
1628 #endif
1629 #ifdef SIGCHLD
1630 signal (SIGCHLD, handle_CHLD);
1631 #endif
1632 #ifdef SIGTTIN
1633 signal (SIGTTIN, handle_TTIN);
1634 #endif
1635 #ifdef SIGTTOU
1636 signal (SIGTTOU, handle_TTOU);
1637 #endif
1638 #ifdef SIGIO
1639 signal (SIGIO, handle_IO);
1640 #endif
1641 #ifdef SIGXCPU
1642 signal (SIGXCPU, handle_XCPU);
1643 #endif
1644 #ifdef SIGXFSZ
1645 signal (SIGXFSZ, handle_XFSZ);
1646 #endif
1647 #ifdef SIGVTALRM
1648 signal (SIGVTALRM, handle_VTALRM);
1649 #endif
1650 #ifdef SIGPROF
1651 signal (SIGPROF, handle_PROF);
1652 #endif
1653 #ifdef SIGWINCH
1654 signal (SIGWINCH, handle_WINCH);
1655 #endif
1656 #if defined(SIGLOST) && (!defined(SIGABRT) || SIGLOST != SIGABRT)
1657 signal (SIGLOST, handle_LOST);
1658 #endif
1659 #ifdef SIGUSR1
1660 signal (SIGUSR1, handle_USR1);
1661 #endif
1662 #ifdef SIGUSR2
1663 signal (SIGUSR2, handle_USR2);
1664 #endif
1665 #ifdef SIGPWR
1666 signal (SIGPWR, handle_PWR);
1667 #endif
1668 #if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
1669 signal (SIGPOLL, handle_POLL);
1670 #endif
1671 #ifdef SIGWIND
1672 signal (SIGWIND, handle_WIND);
1673 #endif
1674 #ifdef SIGPHONE
1675 signal (SIGPHONE, handle_PHONE);
1676 #endif
1677 #ifdef SIGWAITING
1678 signal (SIGWAITING, handle_WAITING);
1679 #endif
1680 #ifdef SIGLWP
1681 signal (SIGLWP, handle_LWP);
1682 #endif
1683 #ifdef SIGDANGER
1684 signal (SIGDANGER, handle_DANGER);
1685 #endif
1686 #ifdef SIGGRANT
1687 signal (SIGGRANT, handle_GRANT);
1688 #endif
1689 #ifdef SIGRETRACT
1690 signal (SIGRETRACT, handle_RETRACT);
1691 #endif
1692 #ifdef SIGMSG
1693 signal (SIGMSG, handle_MSG);
1694 #endif
1695 #ifdef SIGSOUND
1696 signal (SIGSOUND, handle_SOUND);
1697 #endif
1698 #ifdef SIGSAK
1699 signal (SIGSAK, handle_SAK);
1700 #endif
1701 #ifdef SIGPRIO
1702 signal (SIGPRIO, handle_PRIO);
1703 #endif
1704 #ifdef __Lynx__
1705 /* Lynx doesn't seem to have anything in signal.h for this. */
1706 signal (33, handle_33);
1707 signal (34, handle_34);
1708 signal (35, handle_35);
1709 signal (36, handle_36);
1710 signal (37, handle_37);
1711 signal (38, handle_38);
1712 signal (39, handle_39);
1713 signal (40, handle_40);
1714 signal (41, handle_41);
1715 signal (42, handle_42);
1716 signal (43, handle_43);
1717 signal (44, handle_44);
1718 signal (45, handle_45);
1719 signal (46, handle_46);
1720 signal (47, handle_47);
1721 signal (48, handle_48);
1722 signal (49, handle_49);
1723 signal (50, handle_50);
1724 signal (51, handle_51);
1725 signal (52, handle_52);
1726 signal (53, handle_53);
1727 signal (54, handle_54);
1728 signal (55, handle_55);
1729 signal (56, handle_56);
1730 signal (57, handle_57);
1731 signal (58, handle_58);
1732 signal (59, handle_59);
1733 signal (60, handle_60);
1734 signal (61, handle_61);
1735 signal (62, handle_62);
1736 signal (63, handle_63);
1737 #endif /* lynx */
1738 signal (SIGTERM, handle_TERM);
1739
1740 x = 0;
1741
1742 gen_ABRT ();
1743 gen_HUP ();
1744 gen_QUIT ();
1745 gen_ILL ();
1746 gen_EMT ();
1747 gen_FPE ();
1748 gen_BUS ();
1749 gen_SEGV ();
1750 gen_SYS ();
1751 gen_PIPE ();
1752 gen_ALRM ();
1753 gen_URG ();
1754 gen_TSTP ();
1755 gen_CONT ();
1756 gen_CHLD ();
1757 gen_TTIN ();
1758 gen_TTOU ();
1759 gen_IO ();
1760 gen_XCPU ();
1761 gen_XFSZ ();
1762 gen_VTALRM ();
1763 gen_PROF ();
1764 gen_WINCH ();
1765 gen_LOST ();
1766 gen_USR1 ();
1767 gen_USR2 ();
1768 gen_PWR ();
1769 gen_POLL ();
1770 gen_WIND ();
1771 gen_PHONE ();
1772 gen_WAITING ();
1773 gen_LWP ();
1774 gen_DANGER ();
1775 gen_GRANT ();
1776 gen_RETRACT ();
1777 gen_MSG ();
1778 gen_SOUND ();
1779 gen_SAK ();
1780 gen_PRIO ();
1781 gen_33 ();
1782 gen_34 ();
1783 gen_35 ();
1784 gen_36 ();
1785 gen_37 ();
1786 gen_38 ();
1787 gen_39 ();
1788 gen_40 ();
1789 gen_41 ();
1790 gen_42 ();
1791 gen_43 ();
1792 gen_44 ();
1793 gen_45 ();
1794 gen_46 ();
1795 gen_47 ();
1796 gen_48 ();
1797 gen_49 ();
1798 gen_50 ();
1799 gen_51 ();
1800 gen_52 ();
1801 gen_53 ();
1802 gen_54 ();
1803 gen_55 ();
1804 gen_56 ();
1805 gen_57 ();
1806 gen_58 ();
1807 gen_59 ();
1808 gen_60 ();
1809 gen_61 ();
1810 gen_62 ();
1811 gen_63 ();
1812 gen_TERM ();
1813
1814 return 0;
1815 }
This page took 0.245555 seconds and 3 git commands to generate.