source: branches/libc-0.6/src/gcc/libf2c/libF77/setsig.c

Last change on this file was 1392, checked in by bird, 21 years ago

This commit was generated by cvs2svn to compensate for changes in r1391,
which included commits to RCS files with non-trunk default branches.

  • Property cvs2svn:cvs-rev set to 1.1.1.2
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 1.2 KB
Line 
1/* Set up the signal behavior. */
2
3#include <stdio.h>
4#include "signal1.h"
5
6#ifndef SIGIOT
7#ifdef SIGABRT
8#define SIGIOT SIGABRT
9#endif
10#endif
11
12#include <stdlib.h>
13
14extern void sig_die (char *, int);
15
16static void
17sigfdie (Sigarg)
18{
19 Use_Sigarg;
20 sig_die ("Floating Exception", 1);
21}
22
23
24static void
25sigidie (Sigarg)
26{
27 Use_Sigarg;
28 sig_die ("IOT Trap", 1);
29}
30
31#ifdef SIGQUIT
32static void
33sigqdie (Sigarg)
34{
35 Use_Sigarg;
36 sig_die ("Quit signal", 1);
37}
38#endif
39
40
41static void
42sigindie (Sigarg)
43{
44 Use_Sigarg;
45 sig_die ("Interrupt", 0);
46}
47
48static void
49sigtdie (Sigarg)
50{
51 Use_Sigarg;
52 sig_die ("Killed", 0);
53}
54
55#ifdef SIGTRAP
56static void
57sigtrdie (Sigarg)
58{
59 Use_Sigarg;
60 sig_die ("Trace trap", 1);
61}
62#endif
63
64
65void
66f_setsig ()
67{
68 signal1 (SIGFPE, sigfdie); /* ignore underflow, enable overflow */
69#ifdef SIGIOT
70 signal1 (SIGIOT, sigidie);
71#endif
72#ifdef SIGTRAP
73 signal1 (SIGTRAP, sigtrdie);
74#endif
75#ifdef SIGQUIT
76 if (signal1 (SIGQUIT, sigqdie) == SIG_IGN)
77 signal1 (SIGQUIT, SIG_IGN);
78#endif
79 if (signal1 (SIGINT, sigindie) == SIG_IGN)
80 signal1 (SIGINT, SIG_IGN);
81 signal1 (SIGTERM, sigtdie);
82
83#ifdef pdp11
84 ldfps (01200); /* detect overflow as an exception */
85#endif
86}
Note: See TracBrowser for help on using the repository browser.