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