xref: /titanic_50/usr/src/lib/libbc/inc/include/signal.h (revision c77a61a72b5ecdc507d6cf104142edd371a16c84)
1 #pragma ident	"%Z%%M%	%I%	%E% SMI"
2 
3 /*
4  * Copyright (c) 1982 Regents of the University of California.
5  * All rights reserved.  The Berkeley software License Agreement
6  * specifies the terms and conditions for redistribution.
7  *
8  * Copyright (c) 1987 by Sun Microsystems, Inc.
9  */
10 
11 #ifndef	__signal_h
12 #define	__signal_h
13 
14 #ifndef	_POSIX_SOURCE
15 #include <sys/signal.h>
16 #else
17 /*
18  * All of the below is drawn from sys/signal.h.  Adding anything here means you
19  * add it in sys/signal.h as well.
20  */
21 #define	SIGHUP	1	/* hangup */
22 #define	SIGINT	2	/* interrupt */
23 #define	SIGQUIT	3	/* quit */
24 #define	SIGILL	4	/* illegal instruction (not reset when caught) */
25 #define	SIGTRAP	5	/* trace trap (not reset when caught) */
26 #define	SIGIOT	6	/* IOT instruction */
27 #define	SIGABRT 6	/* used by abort, replace SIGIOT in the future */
28 #define	SIGEMT	7	/* EMT instruction */
29 #define	SIGFPE	8	/* floating point exception */
30 #define	SIGKILL	9	/* kill (cannot be caught or ignored) */
31 #define	SIGBUS	10	/* bus error */
32 #define	SIGSEGV	11	/* segmentation violation */
33 #define	SIGSYS	12	/* bad argument to system call */
34 #define	SIGPIPE	13	/* write on a pipe with no one to read it */
35 #define	SIGALRM	14	/* alarm clock */
36 #define	SIGTERM	15	/* software termination signal from kill */
37 #define	SIGURG	16	/* urgent condition on IO channel */
38 #define	SIGSTOP	17	/* sendable stop signal not from tty */
39 #define	SIGTSTP	18	/* stop signal from tty */
40 #define	SIGCONT	19	/* continue a stopped process */
41 #define	SIGCHLD	20	/* to parent on child stop or exit */
42 #define	SIGCLD	20	/* System V name for SIGCHLD */
43 #define	SIGTTIN	21	/* to readers pgrp upon background tty read */
44 #define	SIGTTOU	22	/* like TTIN for output if (tp->t_local&LTOSTOP) */
45 #define	SIGIO	23	/* input/output possible signal */
46 #define	SIGPOLL	SIGIO	/* System V name for SIGIO */
47 #define	SIGXCPU	24	/* exceeded CPU time limit */
48 #define	SIGXFSZ	25	/* exceeded file size limit */
49 #define	SIGVTALRM 26	/* virtual time alarm */
50 #define	SIGPROF	27	/* profiling time alarm */
51 #define	SIGWINCH 28	/* window changed */
52 #define	SIGLOST 29	/* resource lost (eg, record-lock lost) */
53 #define	SIGUSR1 30	/* user defined signal 1 */
54 #define	SIGUSR2 31	/* user defined signal 2 */
55 
56 /* signal() args & returns */
57 #define	SIG_ERR		(void (*)())-1
58 #define	SIG_DFL		(void (*)())0
59 #define	SIG_IGN		(void (*)())1
60 #define	SIG_HOLD	(void (*)())3
61 
62 /* sigprocmask flags */
63 #define	SIG_BLOCK		0x0001
64 #define	SIG_UNBLOCK		0x0002
65 #define	SIG_SETMASK		0x0004
66 
67 /* sa_flags flag; also supports all the sigvec flags in sys/signal.h */
68 #define	SA_NOCLDSTOP	0x0008	/* don't send a SIGCHLD on child stop */
69 
70 #include <sys/stdtypes.h>	/* for sigset_t */
71 
72 struct sigaction {
73 	void 		(*sa_handler)();
74 	sigset_t	sa_mask;
75 	int		sa_flags;
76 };
77 void	(*signal())();
78 int	kill(/* pid_t p, int sig */);
79 int	sigaction(/* int signo,
80 	    struct sigaction *act, struct sigaction *oldact */);
81 int	sigaddset(/* sigset_t *mask, int signo */);
82 int	sigdelset(/* sigset_t *mask, int signo */);
83 int	sigemptyset(/* sigset_t *mask */);
84 int	sigfillset(/* sigset_t *mask */);
85 int	sigismember(/* sigset_t *mask, int signo */);
86 int	sigpending(/* sigset_t *set */);
87 int	sigprocmask(/* int how, sigset_t *set, *oldset */);
88 int	sigsuspend(/* sigset_t *mask */);
89 
90 #endif	/* _POSIX_SOURCE */
91 #endif	/* !__signal_h */
92