xref: /original-bsd/sys/sys/signal.h (revision 93cc60fc)
1 /*	signal.h	6.3	84/12/31	*/
2 
3 #ifndef	NSIG
4 #define NSIG	32
5 
6 #define	SIGHUP	1	/* hangup */
7 #define	SIGINT	2	/* interrupt */
8 #define	SIGQUIT	3	/* quit */
9 #define	SIGILL	4	/* illegal instruction (not reset when caught) */
10 #define	    ILL_RESAD_FAULT	0x0	/* reserved addressing fault */
11 #define	    ILL_PRIVIN_FAULT	0x1	/* privileged instruction fault */
12 #define	    ILL_RESOP_FAULT	0x2	/* reserved operand fault */
13 /* CHME, CHMS, CHMU are not yet given back to users reasonably */
14 #define	SIGTRAP	5	/* trace trap (not reset when caught) */
15 #define	SIGIOT	6	/* IOT instruction */
16 #define	SIGEMT	7	/* EMT instruction */
17 #define	SIGFPE	8	/* floating point exception */
18 #define	    FPE_INTOVF_TRAP	0x1	/* integer overflow */
19 #define	    FPE_INTDIV_TRAP	0x2	/* integer divide by zero */
20 #define	    FPE_FLTOVF_TRAP	0x3	/* floating overflow */
21 #define	    FPE_FLTDIV_TRAP	0x4	/* floating/decimal divide by zero */
22 #define	    FPE_FLTUND_TRAP	0x5	/* floating underflow */
23 #define	    FPE_DECOVF_TRAP	0x6	/* decimal overflow */
24 #define	    FPE_SUBRNG_TRAP	0x7	/* subscript out of range */
25 #define	    FPE_FLTOVF_FAULT	0x8	/* floating overflow fault */
26 #define	    FPE_FLTDIV_FAULT	0x9	/* divide by zero floating fault */
27 #define	    FPE_FLTUND_FAULT	0xa	/* floating underflow fault */
28 #define	SIGKILL	9	/* kill (cannot be caught or ignored) */
29 #define	SIGBUS	10	/* bus error */
30 #define	SIGSEGV	11	/* segmentation violation */
31 #define	SIGSYS	12	/* bad argument to system call */
32 #define	SIGPIPE	13	/* write on a pipe with no one to read it */
33 #define	SIGALRM	14	/* alarm clock */
34 #define	SIGTERM	15	/* software termination signal from kill */
35 #define	SIGURG	16	/* urgent condition on IO channel */
36 #define	SIGSTOP	17	/* sendable stop signal not from tty */
37 #define	SIGTSTP	18	/* stop signal from tty */
38 #define	SIGCONT	19	/* continue a stopped process */
39 #define	SIGCHLD	20	/* to parent on child stop or exit */
40 #define	SIGTTIN	21	/* to readers pgrp upon background tty read */
41 #define	SIGTTOU	22	/* like TTIN for output if (tp->t_local&LTOSTOP) */
42 #define	SIGIO	23	/* input/output possible signal */
43 #define	SIGXCPU	24	/* exceeded CPU time limit */
44 #define	SIGXFSZ	25	/* exceeded file size limit */
45 #define	SIGVTALRM 26	/* virtual time alarm */
46 #define	SIGPROF	27	/* profiling time alarm */
47 #define SIGWINCH 28	/* window size changes */
48 
49 #ifndef KERNEL
50 int	(*signal())();
51 #endif
52 
53 /*
54  * Signal vector "template" used in sigvec call.
55  */
56 struct	sigvec {
57 	int	(*sv_handler)();	/* signal handler */
58 	int	sv_mask;		/* signal mask to apply */
59 	int	sv_onstack;		/* if non-zero, take on signal stack */
60 };
61 
62 /*
63  * Structure used in sigstack call.
64  */
65 struct	sigstack {
66 	char	*ss_sp;			/* signal stack pointer */
67 	int	ss_onstack;		/* current status */
68 };
69 
70 /*
71  * Information pushed on stack when a signal is delivered.
72  * This is used by the kernel to restore state following
73  * execution of the signal handler.  It is also made available
74  * to the handler to allow it to properly restore state if
75  * a non-standard exit is performed.
76  */
77 struct	sigcontext {
78 	int	sc_onstack;		/* sigstack state to restore */
79 	int	sc_mask;		/* signal mask to restore */
80 	int	sc_sp;			/* sp to restore */
81 	int	sc_pc;			/* pc to retore */
82 	int	sc_ps;			/* psl to restore */
83 };
84 
85 #define	BADSIG		(int (*)())-1
86 #define	SIG_DFL		(int (*)())0
87 #define	SIG_IGN		(int (*)())1
88 
89 #ifdef KERNEL
90 #define	SIG_CATCH	(int (*)())2
91 #define	SIG_HOLD	(int (*)())3
92 #endif
93 #endif
94 
95 /*
96  * Macro for converting signal number to a mask suitable for
97  * sigblock().
98  */
99 #define sigmask(m)	(1 << ((m)-1))
100