Implement pahole-like 'ptype /o' option
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / sigall.c
CommitLineData
c906108c 1#include <signal.h>
085dd6e6 2#include <unistd.h>
c906108c 3
c906108c
SS
4
5/* Signal handlers, we set breakpoints in them to make sure that the
6 signals really get delivered. */
7
085dd6e6
JM
8void
9handle_ABRT (int sig)
c906108c
SS
10{
11}
12
085dd6e6
JM
13void
14handle_HUP (int sig)
c906108c
SS
15{
16}
17
085dd6e6
JM
18void
19handle_QUIT (int sig)
c906108c
SS
20{
21}
22
085dd6e6
JM
23void
24handle_ILL (int sig)
c906108c
SS
25{
26}
27
085dd6e6
JM
28void
29handle_EMT (int sig)
c906108c
SS
30{
31}
32
085dd6e6
JM
33void
34handle_FPE (int sig)
c906108c
SS
35{
36}
37
085dd6e6
JM
38void
39handle_BUS (int sig)
c906108c
SS
40{
41}
42
085dd6e6
JM
43void
44handle_SEGV (int sig)
c906108c
SS
45{
46}
47
085dd6e6
JM
48void
49handle_SYS (int sig)
c906108c
SS
50{
51}
52
085dd6e6
JM
53void
54handle_PIPE (int sig)
c906108c
SS
55{
56}
57
085dd6e6
JM
58void
59handle_ALRM (int sig)
c906108c
SS
60{
61}
62
085dd6e6
JM
63void
64handle_URG (int sig)
c906108c
SS
65{
66}
67
085dd6e6
JM
68void
69handle_TSTP (int sig)
c906108c
SS
70{
71}
72
085dd6e6
JM
73void
74handle_CONT (int sig)
c906108c
SS
75{
76}
77
085dd6e6
JM
78void
79handle_CHLD (int sig)
c906108c
SS
80{
81}
82
085dd6e6
JM
83void
84handle_TTIN (int sig)
c906108c
SS
85{
86}
87
085dd6e6
JM
88void
89handle_TTOU (int sig)
c906108c
SS
90{
91}
92
085dd6e6
JM
93void
94handle_IO (int sig)
c906108c
SS
95{
96}
97
085dd6e6
JM
98void
99handle_XCPU (int sig)
c906108c
SS
100{
101}
102
085dd6e6
JM
103void
104handle_XFSZ (int sig)
c906108c
SS
105{
106}
107
085dd6e6
JM
108void
109handle_VTALRM (int sig)
c906108c
SS
110{
111}
112
085dd6e6
JM
113void
114handle_PROF (int sig)
c906108c
SS
115{
116}
117
085dd6e6
JM
118void
119handle_WINCH (int sig)
c906108c
SS
120{
121}
122
085dd6e6
JM
123void
124handle_LOST (int sig)
c906108c
SS
125{
126}
127
085dd6e6
JM
128void
129handle_USR1 (int sig)
c906108c
SS
130{
131}
132
085dd6e6
JM
133void
134handle_USR2 (int sig)
c906108c
SS
135{
136}
137
085dd6e6
JM
138void
139handle_PWR (int sig)
c906108c
SS
140{
141}
142
085dd6e6
JM
143void
144handle_POLL (int sig)
c906108c
SS
145{
146}
147
085dd6e6
JM
148void
149handle_WIND (int sig)
c906108c
SS
150{
151}
152
085dd6e6
JM
153void
154handle_PHONE (int sig)
c906108c
SS
155{
156}
157
085dd6e6
JM
158void
159handle_WAITING (int sig)
c906108c
SS
160{
161}
162
085dd6e6
JM
163void
164handle_LWP (int sig)
c906108c
SS
165{
166}
167
085dd6e6
JM
168void
169handle_DANGER (int sig)
c906108c
SS
170{
171}
172
085dd6e6
JM
173void
174handle_GRANT (int sig)
c906108c
SS
175{
176}
177
085dd6e6
JM
178void
179handle_RETRACT (int sig)
c906108c
SS
180{
181}
182
085dd6e6
JM
183void
184handle_MSG (int sig)
c906108c
SS
185{
186}
187
085dd6e6
JM
188void
189handle_SOUND (int sig)
c906108c
SS
190{
191}
192
085dd6e6
JM
193void
194handle_SAK (int sig)
c906108c
SS
195{
196}
197
085dd6e6
JM
198void
199handle_PRIO (int sig)
c906108c
SS
200{
201}
202
085dd6e6
JM
203void
204handle_33 (int sig)
c906108c
SS
205{
206}
207
085dd6e6
JM
208void
209handle_34 (int sig)
c906108c
SS
210{
211}
212
085dd6e6
JM
213void
214handle_35 (int sig)
c906108c
SS
215{
216}
217
085dd6e6
JM
218void
219handle_36 (int sig)
c906108c
SS
220{
221}
222
085dd6e6
JM
223void
224handle_37 (int sig)
c906108c
SS
225{
226}
227
085dd6e6
JM
228void
229handle_38 (int sig)
c906108c
SS
230{
231}
232
085dd6e6
JM
233void
234handle_39 (int sig)
c906108c
SS
235{
236}
237
085dd6e6
JM
238void
239handle_40 (int sig)
c906108c
SS
240{
241}
242
085dd6e6
JM
243void
244handle_41 (int sig)
c906108c
SS
245{
246}
247
085dd6e6
JM
248void
249handle_42 (int sig)
c906108c
SS
250{
251}
252
085dd6e6
JM
253void
254handle_43 (int sig)
c906108c
SS
255{
256}
257
085dd6e6
JM
258void
259handle_44 (int sig)
c906108c
SS
260{
261}
262
085dd6e6
JM
263void
264handle_45 (int sig)
c906108c
SS
265{
266}
267
085dd6e6
JM
268void
269handle_46 (int sig)
c906108c
SS
270{
271}
272
085dd6e6
JM
273void
274handle_47 (int sig)
c906108c
SS
275{
276}
277
085dd6e6
JM
278void
279handle_48 (int sig)
c906108c
SS
280{
281}
282
085dd6e6
JM
283void
284handle_49 (int sig)
c906108c
SS
285{
286}
287
085dd6e6
JM
288void
289handle_50 (int sig)
c906108c
SS
290{
291}
292
085dd6e6
JM
293void
294handle_51 (int sig)
c906108c
SS
295{
296}
297
085dd6e6
JM
298void
299handle_52 (int sig)
c906108c
SS
300{
301}
302
085dd6e6
JM
303void
304handle_53 (int sig)
c906108c
SS
305{
306}
307
085dd6e6
JM
308void
309handle_54 (int sig)
c906108c
SS
310{
311}
312
085dd6e6
JM
313void
314handle_55 (int sig)
c906108c
SS
315{
316}
317
085dd6e6
JM
318void
319handle_56 (int sig)
c906108c
SS
320{
321}
322
085dd6e6
JM
323void
324handle_57 (int sig)
c906108c
SS
325{
326}
327
085dd6e6
JM
328void
329handle_58 (int sig)
c906108c
SS
330{
331}
332
085dd6e6
JM
333void
334handle_59 (int sig)
c906108c
SS
335{
336}
337
085dd6e6
JM
338void
339handle_60 (int sig)
c906108c
SS
340{
341}
342
085dd6e6
JM
343void
344handle_61 (int sig)
c906108c
SS
345{
346}
347
085dd6e6
JM
348void
349handle_62 (int sig)
c906108c
SS
350{
351}
352
085dd6e6
JM
353void
354handle_63 (int sig)
c906108c
SS
355{
356}
357
085dd6e6
JM
358void
359handle_TERM (int sig)
c906108c
SS
360{
361}
362\f
3657956b
GB
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
371int
372gen_ILL ()
373{
374 kill (getpid (), SIGILL);
375 return 0;
376}
377
c906108c
SS
378int
379gen_ABRT ()
380{
381 kill (getpid (), SIGABRT);
085dd6e6 382 return 0;
c906108c
SS
383}
384
3657956b
GB
385int x;
386
387int
388gen_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
407int
408gen_SEGV ()
409{
410 kill (getpid (), SIGSEGV);
411 return 0;
412}
413
414int
415gen_TERM ()
416{
417 kill (getpid (), SIGTERM);
418 return 0;
419}
420
421/* All other signals need preprocessor conditionals. */
422
c906108c
SS
423int
424gen_HUP ()
425{
426#ifdef SIGHUP
427 kill (getpid (), SIGHUP);
428#else
429 handle_HUP (0);
430#endif
085dd6e6 431return 0;
c906108c
SS
432}
433
434int
435gen_QUIT ()
436{
437#ifdef SIGQUIT
438 kill (getpid (), SIGQUIT);
439#else
440 handle_QUIT (0);
441#endif
085dd6e6 442return 0;
c906108c
SS
443}
444
c906108c
SS
445int
446gen_EMT ()
447{
448#ifdef SIGEMT
449 kill (getpid (), SIGEMT);
450#else
451 handle_EMT (0);
452#endif
085dd6e6 453return 0;
c906108c
SS
454}
455
c906108c
SS
456int
457gen_BUS ()
458{
459#ifdef SIGBUS
460 kill (getpid (), SIGBUS);
461#else
462 handle_BUS (0);
463#endif
085dd6e6 464return 0;
c906108c
SS
465}
466
c906108c
SS
467int
468gen_SYS ()
469{
470#ifdef SIGSYS
471 kill (getpid (), SIGSYS);
472#else
473 handle_SYS (0);
474#endif
085dd6e6 475return 0;
c906108c
SS
476}
477
478int
479gen_PIPE ()
480{
481#ifdef SIGPIPE
482 kill (getpid (), SIGPIPE);
483#else
484 handle_PIPE (0);
485#endif
085dd6e6 486return 0;
c906108c
SS
487}
488
489int
490gen_ALRM ()
491{
492#ifdef SIGALRM
493 kill (getpid (), SIGALRM);
494#else
495 handle_ALRM (0);
496#endif
085dd6e6 497return 0;
c906108c
SS
498}
499
500int
501gen_URG ()
502{
503#ifdef SIGURG
504 kill (getpid (), SIGURG);
505#else
506 handle_URG (0);
507#endif
085dd6e6 508return 0;
c906108c
SS
509}
510
511int
512gen_TSTP ()
513{
514#ifdef SIGTSTP
515 kill (getpid (), SIGTSTP);
516#else
517 handle_TSTP (0);
518#endif
085dd6e6 519return 0;
c906108c
SS
520}
521
522int
523gen_CONT ()
524{
525#ifdef SIGCONT
526 kill (getpid (), SIGCONT);
527#else
528 handle_CONT (0);
529#endif
085dd6e6 530return 0;
c906108c
SS
531}
532
533int
534gen_CHLD ()
535{
536#ifdef SIGCHLD
537 kill (getpid (), SIGCHLD);
538#else
539 handle_CHLD (0);
540#endif
085dd6e6 541return 0;
c906108c
SS
542}
543
544int
545gen_TTIN ()
546{
547#ifdef SIGTTIN
548 kill (getpid (), SIGTTIN);
549#else
550 handle_TTIN (0);
551#endif
085dd6e6 552return 0;
c906108c
SS
553}
554
555int
556gen_TTOU ()
557{
558#ifdef SIGTTOU
559 kill (getpid (), SIGTTOU);
560#else
561 handle_TTOU (0);
562#endif
085dd6e6 563return 0;
c906108c
SS
564}
565
566int
567gen_IO ()
568{
569#ifdef SIGIO
570 kill (getpid (), SIGIO);
571#else
572 handle_IO (0);
573#endif
085dd6e6 574return 0;
c906108c
SS
575}
576
577int
578gen_XCPU ()
579{
580#ifdef SIGXCPU
581 kill (getpid (), SIGXCPU);
582#else
583 handle_XCPU (0);
584#endif
085dd6e6 585return 0;
c906108c
SS
586}
587
588int
589gen_XFSZ ()
590{
591#ifdef SIGXFSZ
592 kill (getpid (), SIGXFSZ);
593#else
594 handle_XFSZ (0);
595#endif
085dd6e6 596return 0;
c906108c
SS
597}
598
599int
600gen_VTALRM ()
601{
602#ifdef SIGVTALRM
603 kill (getpid (), SIGVTALRM);
604#else
605 handle_VTALRM (0);
606#endif
085dd6e6 607return 0;
c906108c
SS
608}
609
610int
611gen_PROF ()
612{
613#ifdef SIGPROF
614 kill (getpid (), SIGPROF);
615#else
616 handle_PROF (0);
617#endif
085dd6e6 618return 0;
c906108c
SS
619}
620
621int
622gen_WINCH ()
623{
624#ifdef SIGWINCH
625 kill (getpid (), SIGWINCH);
626#else
627 handle_WINCH (0);
628#endif
085dd6e6 629return 0;
c906108c
SS
630}
631
632int
633gen_LOST ()
634{
73ba372c 635#if defined(SIGLOST) && SIGLOST != SIGABRT
c906108c
SS
636 kill (getpid (), SIGLOST);
637#else
638 handle_LOST (0);
639#endif
085dd6e6 640return 0;
c906108c
SS
641}
642
643int
644gen_USR1 ()
645{
646#ifdef SIGUSR1
647 kill (getpid (), SIGUSR1);
648#else
649 handle_USR1 (0);
650#endif
085dd6e6 651return 0;
c906108c
SS
652}
653
654int
655gen_USR2 ()
656{
657#ifdef SIGUSR2
658 kill (getpid (), SIGUSR2);
659#else
660 handle_USR2 (0);
661#endif
085dd6e6 662return 0;
c906108c
SS
663}
664
665int
666gen_PWR ()
667{
f1300300 668#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
c906108c
SS
669 kill (getpid (), SIGPWR);
670#else
671 handle_PWR (0);
672#endif
085dd6e6 673return 0;
c906108c
SS
674}
675
676int
677gen_POLL ()
678{
679#if defined (SIGPOLL) && (!defined (SIGIO) || SIGPOLL != SIGIO)
680 kill (getpid (), SIGPOLL);
681#else
682 handle_POLL (0);
683#endif
085dd6e6 684return 0;
c906108c
SS
685}
686
687int
688gen_WIND ()
689{
690#ifdef SIGWIND
691 kill (getpid (), SIGWIND);
692#else
693 handle_WIND (0);
694#endif
085dd6e6 695return 0;
c906108c
SS
696}
697
698int
699gen_PHONE ()
700{
701#ifdef SIGPHONE
702 kill (getpid (), SIGPHONE);
703#else
704 handle_PHONE (0);
705#endif
085dd6e6 706return 0;
c906108c
SS
707}
708
709int
710gen_WAITING ()
711{
712#ifdef SIGWAITING
713 kill (getpid (), SIGWAITING);
714#else
715 handle_WAITING (0);
716#endif
085dd6e6 717return 0;
c906108c
SS
718}
719
720int
721gen_LWP ()
722{
723#ifdef SIGLWP
724 kill (getpid (), SIGLWP);
725#else
726 handle_LWP (0);
727#endif
085dd6e6 728return 0;
c906108c
SS
729}
730
731int
732gen_DANGER ()
733{
734#ifdef SIGDANGER
735 kill (getpid (), SIGDANGER);
736#else
737 handle_DANGER (0);
738#endif
085dd6e6 739return 0;
c906108c
SS
740}
741
742int
743gen_GRANT ()
744{
745#ifdef SIGGRANT
746 kill (getpid (), SIGGRANT);
747#else
748 handle_GRANT (0);
749#endif
085dd6e6 750return 0;
c906108c
SS
751}
752
753int
754gen_RETRACT ()
755{
756#ifdef SIGRETRACT
757 kill (getpid (), SIGRETRACT);
758#else
759 handle_RETRACT (0);
760#endif
085dd6e6 761return 0;
c906108c
SS
762}
763
764int
765gen_MSG ()
766{
767#ifdef SIGMSG
768 kill (getpid (), SIGMSG);
769#else
770 handle_MSG (0);
771#endif
085dd6e6 772return 0;
c906108c
SS
773}
774
775int
776gen_SOUND ()
777{
778#ifdef SIGSOUND
779 kill (getpid (), SIGSOUND);
780#else
781 handle_SOUND (0);
782#endif
085dd6e6 783return 0;
c906108c
SS
784}
785
786int
787gen_SAK ()
788{
789#ifdef SIGSAK
790 kill (getpid (), SIGSAK);
791#else
792 handle_SAK (0);
793#endif
085dd6e6 794return 0;
c906108c
SS
795}
796
797int
798gen_PRIO ()
799{
800#ifdef SIGPRIO
801 kill (getpid (), SIGPRIO);
802#else
803 handle_PRIO (0);
804#endif
085dd6e6 805return 0;
c906108c
SS
806}
807
808int
809gen_33 ()
810{
811#ifdef SIG33
812 kill (getpid (), 33);
813#else
814 handle_33 (0);
815#endif
085dd6e6 816return 0;
c906108c
SS
817}
818
819int
820gen_34 ()
821{
822#ifdef SIG34
823 kill (getpid (), 34);
824#else
825 handle_34 (0);
826#endif
085dd6e6 827return 0;
c906108c
SS
828}
829
830int
831gen_35 ()
832{
833#ifdef SIG35
834 kill (getpid (), 35);
835#else
836 handle_35 (0);
837#endif
085dd6e6 838return 0;
c906108c
SS
839}
840
841int
842gen_36 ()
843{
844#ifdef SIG36
845 kill (getpid (), 36);
846#else
847 handle_36 (0);
848#endif
085dd6e6 849return 0;
c906108c
SS
850}
851
852int
853gen_37 ()
854{
855#ifdef SIG37
856 kill (getpid (), 37);
857#else
858 handle_37 (0);
859#endif
085dd6e6 860return 0;
c906108c
SS
861}
862
863int
864gen_38 ()
865{
866#ifdef SIG38
867 kill (getpid (), 38);
868#else
869 handle_38 (0);
870#endif
085dd6e6 871return 0;
c906108c
SS
872}
873
874int
875gen_39 ()
876{
877#ifdef SIG39
878 kill (getpid (), 39);
879#else
880 handle_39 (0);
881#endif
085dd6e6 882return 0;
c906108c
SS
883}
884
885int
886gen_40 ()
887{
888#ifdef SIG40
889 kill (getpid (), 40);
890#else
891 handle_40 (0);
892#endif
085dd6e6 893return 0;
c906108c
SS
894}
895
896int
897gen_41 ()
898{
899#ifdef SIG41
900 kill (getpid (), 41);
901#else
902 handle_41 (0);
903#endif
085dd6e6 904return 0;
c906108c
SS
905}
906
907int
908gen_42 ()
909{
910#ifdef SIG42
911 kill (getpid (), 42);
912#else
913 handle_42 (0);
914#endif
085dd6e6 915return 0;
c906108c
SS
916}
917
918int
919gen_43 ()
920{
921#ifdef SIG43
922 kill (getpid (), 43);
923#else
924 handle_43 (0);
925#endif
085dd6e6 926return 0;
c906108c
SS
927}
928
929int
930gen_44 ()
931{
932#ifdef SIG44
933 kill (getpid (), 44);
934#else
935 handle_44 (0);
936#endif
085dd6e6 937return 0;
c906108c
SS
938}
939
940int
941gen_45 ()
942{
943#ifdef SIG45
944 kill (getpid (), 45);
945#else
946 handle_45 (0);
947#endif
085dd6e6 948return 0;
c906108c
SS
949}
950
951int
952gen_46 ()
953{
954#ifdef SIG46
955 kill (getpid (), 46);
956#else
957 handle_46 (0);
958#endif
085dd6e6 959return 0;
c906108c
SS
960}
961
962int
963gen_47 ()
964{
965#ifdef SIG47
966 kill (getpid (), 47);
967#else
968 handle_47 (0);
969#endif
085dd6e6 970return 0;
c906108c
SS
971}
972
973int
974gen_48 ()
975{
976#ifdef SIG48
977 kill (getpid (), 48);
978#else
979 handle_48 (0);
980#endif
085dd6e6 981return 0;
c906108c
SS
982}
983
984int
985gen_49 ()
986{
987#ifdef SIG49
988 kill (getpid (), 49);
989#else
990 handle_49 (0);
991#endif
085dd6e6 992return 0;
c906108c
SS
993}
994
995int
996gen_50 ()
997{
998#ifdef SIG50
999 kill (getpid (), 50);
1000#else
1001 handle_50 (0);
1002#endif
085dd6e6 1003return 0;
c906108c
SS
1004}
1005
1006int
1007gen_51 ()
1008{
1009#ifdef SIG51
1010 kill (getpid (), 51);
1011#else
1012 handle_51 (0);
1013#endif
085dd6e6 1014return 0;
c906108c
SS
1015}
1016
1017int
1018gen_52 ()
1019{
1020#ifdef SIG52
1021 kill (getpid (), 52);
1022#else
1023 handle_52 (0);
1024#endif
085dd6e6 1025return 0;
c906108c
SS
1026}
1027
1028int
1029gen_53 ()
1030{
1031#ifdef SIG53
1032 kill (getpid (), 53);
1033#else
1034 handle_53 (0);
1035#endif
085dd6e6 1036return 0;
c906108c
SS
1037}
1038
1039int
1040gen_54 ()
1041{
1042#ifdef SIG54
1043 kill (getpid (), 54);
1044#else
1045 handle_54 (0);
1046#endif
085dd6e6 1047return 0;
c906108c
SS
1048}
1049
1050int
1051gen_55 ()
1052{
1053#ifdef SIG55
1054 kill (getpid (), 55);
1055#else
1056 handle_55 (0);
1057#endif
085dd6e6 1058return 0;
c906108c
SS
1059}
1060
1061int
1062gen_56 ()
1063{
1064#ifdef SIG56
1065 kill (getpid (), 56);
1066#else
1067 handle_56 (0);
1068#endif
085dd6e6 1069return 0;
c906108c
SS
1070}
1071
1072int
1073gen_57 ()
1074{
1075#ifdef SIG57
1076 kill (getpid (), 57);
1077#else
1078 handle_57 (0);
1079#endif
085dd6e6 1080return 0;
c906108c
SS
1081}
1082
1083int
1084gen_58 ()
1085{
1086#ifdef SIG58
1087 kill (getpid (), 58);
1088#else
1089 handle_58 (0);
1090#endif
085dd6e6 1091return 0;
c906108c
SS
1092}
1093
1094int
1095gen_59 ()
1096{
1097#ifdef SIG59
1098 kill (getpid (), 59);
1099#else
1100 handle_59 (0);
1101#endif
085dd6e6 1102return 0;
c906108c
SS
1103}
1104
1105int
1106gen_60 ()
1107{
1108#ifdef SIG60
1109 kill (getpid (), 60);
1110#else
1111 handle_60 (0);
1112#endif
085dd6e6 1113return 0;
c906108c
SS
1114}
1115
1116int
1117gen_61 ()
1118{
1119#ifdef SIG61
1120 kill (getpid (), 61);
1121#else
1122 handle_61 (0);
1123#endif
085dd6e6 1124return 0;
c906108c
SS
1125}
1126
1127int
1128gen_62 ()
1129{
1130#ifdef SIG62
1131 kill (getpid (), 62);
1132#else
1133 handle_62 (0);
1134#endif
085dd6e6 1135return 0;
c906108c
SS
1136}
1137
1138int
1139gen_63 ()
1140{
1141#ifdef SIG63
1142 kill (getpid (), 63);
1143#else
1144 handle_63 (0);
1145#endif
085dd6e6 1146return 0;
c906108c 1147}
c906108c
SS
1148\f
1149int
1150main ()
1151{
4b071aec
DE
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
3657956b
GB
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);
c906108c 1171 signal (SIGABRT, handle_ABRT);
3657956b
GB
1172 signal (SIGFPE, handle_FPE);
1173 signal (SIGSEGV, handle_SEGV);
1174 signal (SIGTERM, handle_TERM);
1175
1176 /* All other signals need preprocessor conditionals. */
c906108c
SS
1177#ifdef SIGHUP
1178 signal (SIGHUP, handle_HUP);
1179#endif
1180#ifdef SIGQUIT
1181 signal (SIGQUIT, handle_QUIT);
1182#endif
c906108c
SS
1183#ifdef SIGEMT
1184 signal (SIGEMT, handle_EMT);
1185#endif
c906108c
SS
1186#ifdef SIGBUS
1187 signal (SIGBUS, handle_BUS);
1188#endif
c906108c
SS
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
73ba372c 1234#if defined(SIGLOST) && SIGLOST != SIGABRT
c906108c
SS
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
f1300300 1243#if defined(SIGPWR) && (!defined (SIGLOST) || SIGPWR != SIGLOST)
c906108c
SS
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 */
c906108c
SS
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}
This page took 1.995939 seconds and 4 git commands to generate.