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