1 /* The <signal.h> header defines all the ANSI and POSIX signals.
2 * MINIX supports all the signals required by POSIX. They are defined below.
3 * Some additional signals are also supported.
9 /* Here are types that are closely associated with signal handling. */
10 typedef int sig_atomic_t;
13 typedef unsigned short sigset_t;
17 #define _NSIG 16 /* number of signals used */
19 #define SIGHUP 1 /* hangup */
20 #define SIGINT 2 /* interrupt (DEL) */
21 #define SIGQUIT 3 /* quit (ASCII FS) */
22 #define SIGILL 4 /* illegal instruction */
23 #define SIGTRAP 5 /* trace trap (not reset when caught) */
24 #define SIGABRT 6 /* IOT instruction */
25 #define SIGIOT 6 /* SIGABRT for people who speak PDP-11 */
26 #define SIGUNUSED 7 /* spare code */
27 #define SIGFPE 8 /* floating point exception */
28 #define SIGKILL 9 /* kill (cannot be caught or ignored) */
29 #define SIGUSR1 10 /* user defined signal # 1 */
30 #define SIGSEGV 11 /* segmentation violation */
31 #define SIGUSR2 12 /* user defined signal # 2 */
32 #define SIGSYS 12 /* the usual UNIX name for this signal num */
33 #define SIGPIPE 13 /* write on a pipe with no one to read it */
34 #define SIGALRM 14 /* alarm clock */
35 #define SIGTERM 15 /* software termination signal from kill */
36 #define SIGSTKFLT 16 /* used by kernel to indicate stack fault */
38 #define SIGEMT 7 /* obsolete */
39 #define SIGBUS 10 /* obsolete */
41 /* POSIX requires the following signals to be defined, even if they are
42 * not supported. Here are the definitions, but they are not supported.
44 #define SIGCHLD 17 /* child process terminated or stopped */
45 #define SIGCONT 18 /* continue if stopped */
46 #define SIGSTOP 19 /* stop signal */
47 #define SIGTSTP 20 /* interactive stop signal */
48 #define SIGTTIN 21 /* background process wants to read */
49 #define SIGTTOU 22 /* background process wants to write */
52 #define SA_NOCLDSTOP 1 /* signal parent if child stops */
54 #endif /* _POSIX_SOURCE */
56 /* POSIX requires these values for use on system calls involving signals. */
57 #define SIG_BLOCK 0 /* for blocking signals */
58 #define SIG_UNBLOCK 1 /* for unblocking signals */
59 #define SIG_SETMASK 2 /* for setting the signal mask */
65 /* Macros used as function pointers and one awful prototype. */
67 #define SIG_DFL ((void (*)(int))0) /* default signal handling */
68 #define SIG_IGN ((void (*)(int))1) /* ignore signal */
69 #define SIG_ERR ((void (*)(int))-1)
71 void (*signal(int _sig, void (*_func)(int)))(int);
75 void (*sa_handler)(int); /* SIG_DFL, SIG_IGN, or pointer to function */
76 sigset_t sa_mask; /* signals to be blocked during handler */
77 int sa_flags; /* special flags */
82 #define SIG_DFL ((void (*)())0) /* default signal handling */
83 #define SIG_IGN ((void (*)())1) /* ignore signal */
84 #define SIG_ERR ((void (*)())-1)
88 #ifdef _POSIX_SOURCE /* otherwise sigset_t is not defined */
90 void (*sa_handler)(); /* SIG_DFL, SIG_IGN, or pointer to function */
91 sigset_t sa_mask; /* signals to be blocked during handler */
92 int sa_flags; /* special flags */
98 /* Function Prototypes. */
99 _PROTOTYPE( int raise, (int _sig) );
102 _PROTOTYPE( int kill, (pid_t _pid, int _sig) );
103 _PROTOTYPE( int sigaddset, (sigset_t *_set) );
104 _PROTOTYPE( int sigdelset, (sigset_t *_set) );
105 _PROTOTYPE( int sigemptyset, (sigset_t *_set) );
106 _PROTOTYPE( int sigfillset, (sigset_t *_set) );
107 _PROTOTYPE( int sigismember, (sigset_t *_set, int _signo) );
108 _PROTOTYPE( int sigpending, (sigset_t *set) );
109 _PROTOTYPE( int sigprocmask, (int _how, sigset_t *_set, sigset_t *_oset));
110 _PROTOTYPE( int sigsuspend, (sigset_t *_sigmask) );
111 _PROTOTYPE( int sigaction,
112 (int _sig, struct sigaction *_a, struct sigaction *_oact) );
115 #endif /* _SIGNAL_H */