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.
14 #include <sys/types.h>
18 /* Here are types that are closely associated with signal handling. */
19 typedef int sig_atomic_t;
24 typedef unsigned long sigset_t
;
28 /* Regular signals. */
29 #define SIGHUP 1 /* hangup */
30 #define SIGINT 2 /* interrupt (DEL) */
31 #define SIGQUIT 3 /* quit (ASCII FS) */
32 #define SIGILL 4 /* illegal instruction */
33 #define SIGTRAP 5 /* trace trap (not reset when caught) */
34 #define SIGABRT 6 /* IOT instruction */
35 #define SIGBUS 7 /* bus error */
36 #define SIGFPE 8 /* floating point exception */
37 #define SIGKILL 9 /* kill (cannot be caught or ignored) */
38 #define SIGUSR1 10 /* user defined signal # 1 */
39 #define SIGSEGV 11 /* segmentation violation */
40 #define SIGUSR2 12 /* user defined signal # 2 */
41 #define SIGPIPE 13 /* write on a pipe with no one to read it */
42 #define SIGALRM 14 /* alarm clock */
43 #define SIGTERM 15 /* software termination signal from kill */
44 #define SIGEMT 16 /* EMT instruction */
45 #define SIGCHLD 17 /* child process terminated or stopped */
46 #define SIGWINCH 21 /* window size has changed */
48 /* POSIX requires the following signals to be defined, even if they are
49 * not supported. Here are the definitions, but they are not supported.
51 #define SIGCONT 18 /* continue if stopped */
52 #define SIGSTOP 19 /* stop signal */
53 #define SIGTSTP 20 /* interactive stop signal */
54 #define SIGTTIN 22 /* background process wants to read */
55 #define SIGTTOU 23 /* background process wants to write */
57 #define _NSIG 23 /* number of signals used */
60 #define SIGIOT SIGABRT /* for people who speak PDP-11 */
62 /* MINIX specific signals. These signals are not used by user proceses,
63 * but meant to inform system processes, like the PM, about system events.
65 #define SIGKMESS 29 /* new kernel message */
66 #define SIGKSIG 30 /* kernel signal pending */
67 #define SIGKSTOP 31 /* kernel shutting down */
71 /* The sighandler_t type is not allowed unless _POSIX_SOURCE is defined. */
72 typedef void _PROTOTYPE( (*__sighandler_t
), (int) );
74 /* Macros used as function pointers. */
75 #define SIG_ERR ((__sighandler_t) -1) /* error return */
76 #define SIG_DFL ((__sighandler_t) 0) /* default signal handling */
77 #define SIG_IGN ((__sighandler_t) 1) /* ignore signal */
78 #define SIG_HOLD ((__sighandler_t) 2) /* block signal */
79 #define SIG_CATCH ((__sighandler_t) 3) /* catch signal */
80 #define SIG_MESS ((__sighandler_t) 4) /* pass as message (MINIX) */
84 __sighandler_t sa_handler
; /* SIG_DFL, SIG_IGN, or pointer to function */
85 sigset_t sa_mask
; /* signals to be blocked during handler */
86 int sa_flags
; /* special flags */
89 /* Fields for sa_flags. */
90 #define SA_ONSTACK 0x0001 /* deliver signal on alternate stack */
91 #define SA_RESETHAND 0x0002 /* reset signal handler when signal caught */
92 #define SA_NODEFER 0x0004 /* don't block signal while catching it */
93 #define SA_RESTART 0x0008 /* automatic system call restart */
94 #define SA_SIGINFO 0x0010 /* extended signal handling */
95 #define SA_NOCLDWAIT 0x0020 /* don't create zombies */
96 #define SA_NOCLDSTOP 0x0040 /* don't receive SIGCHLD when child stops */
98 /* POSIX requires these values for use with sigprocmask(2). */
99 #define SIG_BLOCK 0 /* for blocking signals */
100 #define SIG_UNBLOCK 1 /* for unblocking signals */
101 #define SIG_SETMASK 2 /* for setting the signal mask */
102 #define SIG_INQUIRE 4 /* for internal use only */
103 #endif /* _POSIX_SOURCE */
105 /* POSIX and ANSI function prototypes. */
106 _PROTOTYPE( int raise
, (int _sig
) );
107 _PROTOTYPE( __sighandler_t signal
, (int _sig
, __sighandler_t _func
) );
110 _PROTOTYPE( int kill
, (pid_t _pid
, int _sig
) );
111 _PROTOTYPE( int killpg
, (pid_t _pgrp
, int _sig
) );
112 _PROTOTYPE( int sigaction
,
113 (int _sig
, const struct sigaction
*_act
, struct sigaction
*_oact
) );
114 _PROTOTYPE( int sigaddset
, (sigset_t
*_set
, int _sig
) );
115 _PROTOTYPE( int sigdelset
, (sigset_t
*_set
, int _sig
) );
116 _PROTOTYPE( int sigemptyset
, (sigset_t
*_set
) );
117 _PROTOTYPE( int sigfillset
, (sigset_t
*_set
) );
118 _PROTOTYPE( int sigismember
, (const sigset_t
*_set
, int _sig
) );
119 _PROTOTYPE( int sigpending
, (sigset_t
*_set
) );
120 _PROTOTYPE( int sigprocmask
,
121 (int _how
, const sigset_t
*_set
, sigset_t
*_oset
) );
122 _PROTOTYPE( int sigsuspend
, (const sigset_t
*_sigmask
) );
125 #endif /* _SIGNAL_H */