2 * signal.h - signal handling
4 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
5 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 /* $Id: signal.h,v 1.7 1994/06/24 11:41:11 ceriel Exp $ */
9 #if !defined(_SIGNAL_H)
12 typedef int sig_atomic_t;
14 #if defined(_POSIX_SOURCE)
16 typedef unsigned short sigset_t;
18 #define SIG_BLOCK 0 /* for blocking signals */
19 #define SIG_UNBLOCK 1 /* for unblocking signals */
20 #define SIG_SETMASK 2 /* for setting the signal mask */
23 void (*sa_handler)(int);/* SIG_DFL, SIG_IGN or pointer to function */
24 sigset_t sa_mask; /* signals blocked during handling */
25 int sa_flags; /* special flags */
30 #define SIG_ERR ((void (*)(int))-1)
31 #if defined(__em22) || defined(__em24) || defined(__em44)
32 #define SIG_DFL ((void (*)(int))-2)
33 #define SIG_IGN ((void (*)(int))-3)
35 #define SIG_DFL ((void (*)(int))0)
36 #define SIG_IGN ((void (*)(int))1)
37 #endif /* no interpretation */
39 #define SIGHUP 1 /* hangup */
40 #define SIGINT 2 /* interrupt */
41 #define SIGQUIT 3 /* quit */
42 #define SIGILL 4 /* illegal instruction (not reset when caught) */
43 #define SIGTRAP 5 /* trace trap (not reset when caught) */
44 #define SIGIOT 6 /* IOT instruction */
45 #define SIGABRT 6 /* ANSI abort trap */
46 #define SIGEMT 7 /* EMT instruction */
47 #define SIGFPE 8 /* floating point exception */
48 #define SIGKILL 9 /* kill (cannot be caught or ignored) */
49 #define SIGBUS 10 /* bus error */
50 #define SIGSEGV 11 /* segmentation violation */
51 #define SIGSYS 12 /* bad argument to system call */
52 #define SIGPIPE 13 /* write on a pipe with no one to read it */
53 #define SIGALRM 14 /* alarm clock */
54 #define SIGTERM 15 /* software termination signal from kill */
56 #define SIGUSR1 16 /* user defined signal 1 */
57 #define SIGUSR2 17 /* user defined signal 2 */
58 #define SIGCLD 18 /* death of a child */
59 #define SIGPWR 19 /* power-fail signal */
61 #elif defined(__BSD4_2)
62 #define SIGURG 16 /* urgent condition */
63 #define SIGSTOP 17 /* stop signal not from tty */
64 #define SIGTSTP 18 /* stop signal from tty */
65 #define SIGCONT 19 /* continue a stopped process */
66 #define SIGCHLD 20 /* death of a child */
67 #define SIGCLD 20 /* System V compat. */
68 #define SIGTTIN 21 /* background tty read */
69 #define SIGTTOU 22 /* background tty write */
70 #define SIGIO 23 /* I/O possible signal */
71 #define SIGPOLL SIGIO /* System V compat. */
72 #define SIGXCPU 24 /* exceeded CPU time limit */
73 #define SIGXFSZ 25 /* exceeded file size limit */
74 #define SIGVTALRM 26 /* virtual time alarm */
75 #define SIGPROF 27 /* profiling time alarm */
76 #define SIGWINCH 28 /* window has changed */
77 #define SIGLOST 29 /* resource lost */
78 #define SIGUSR1 30 /* user defined signal 1 */
79 #define SIGUSR2 31 /* user defined signal 2 */
82 /* The following signals are defined but not supported */
83 #define SIGCHLD 17 /* child process terminated or stopped */
84 #define SIGCONT 18 /* continue if stopped */
85 #define SIGSTOP 19 /* stop signal */
86 #define SIGTSTP 20 /* interactive stop signal */
87 #define SIGTTIN 21 /* background process wants to read */
88 #define SIGTTOU 22 /* background process wants to write */
92 #endif /* __USG or __BSD4_2 */
94 void (*signal(int _sig, void (*_func)(int)))(int);
97 #endif /* _SIGNAL_H */