svr4_signal.h revision 50477
143412Snewton/*
243412Snewton * Copyright (c) 1998 Mark Newton
343412Snewton * Copyright (c) 1994 Christos Zoulas
443412Snewton * All rights reserved.
543412Snewton *
643412Snewton * Redistribution and use in source and binary forms, with or without
743412Snewton * modification, are permitted provided that the following conditions
843412Snewton * are met:
943412Snewton * 1. Redistributions of source code must retain the above copyright
1043412Snewton *    notice, this list of conditions and the following disclaimer.
1143412Snewton * 2. Redistributions in binary form must reproduce the above copyright
1243412Snewton *    notice, this list of conditions and the following disclaimer in the
1343412Snewton *    documentation and/or other materials provided with the distribution.
1443412Snewton * 3. The name of the author may not be used to endorse or promote products
1543412Snewton *    derived from this software without specific prior written permission
1643412Snewton *
1743412Snewton * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1843412Snewton * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1943412Snewton * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2043412Snewton * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
2143412Snewton * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
2243412Snewton * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2343412Snewton * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2443412Snewton * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2543412Snewton * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2643412Snewton * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2749267Snewton *
2850477Speter * $FreeBSD: head/sys/compat/svr4/svr4_signal.h 50477 1999-08-28 01:08:13Z peter $
2943412Snewton */
3043412Snewton
3143412Snewton#ifndef	_SVR4_SIGNAL_H_
3243412Snewton#define	_SVR4_SIGNAL_H_
3343412Snewton
3443412Snewton#include <i386/svr4/svr4_machdep.h>
3543412Snewton#include <svr4/svr4_siginfo.h>
3643412Snewton
3743412Snewton#define	SVR4_SIGHUP	 1
3843412Snewton#define	SVR4_SIGINT	 2
3943412Snewton#define	SVR4_SIGQUIT	 3
4043412Snewton#define	SVR4_SIGILL	 4
4143412Snewton#define	SVR4_SIGTRAP	 5
4243412Snewton#define	SVR4_SIGIOT	 6
4343412Snewton#define	SVR4_SIGABRT	 6
4443412Snewton#define	SVR4_SIGEMT	 7
4543412Snewton#define	SVR4_SIGFPE	 8
4643412Snewton#define	SVR4_SIGKILL	 9
4743412Snewton#define	SVR4_SIGBUS	10
4843412Snewton#define	SVR4_SIGSEGV	11
4943412Snewton#define	SVR4_SIGSYS	12
5043412Snewton#define	SVR4_SIGPIPE	13
5143412Snewton#define	SVR4_SIGALRM	14
5243412Snewton#define	SVR4_SIGTERM	15
5343412Snewton#define	SVR4_SIGUSR1	16
5443412Snewton#define	SVR4_SIGUSR2	17
5543412Snewton#define	SVR4_SIGCLD	18
5643412Snewton#define	SVR4_SIGCHLD	18
5743412Snewton#define	SVR4_SIGPWR	19
5843412Snewton#define	SVR4_SIGWINCH	20
5943412Snewton#define	SVR4_SIGURG	21
6043412Snewton#define	SVR4_SIGPOLL	22
6143412Snewton#define	SVR4_SIGIO	22
6243412Snewton#define	SVR4_SIGSTOP	23
6343412Snewton#define	SVR4_SIGTSTP	24
6443412Snewton#define	SVR4_SIGCONT	25
6543412Snewton#define	SVR4_SIGTTIN	26
6643412Snewton#define	SVR4_SIGTTOU	27
6743412Snewton#define	SVR4_SIGVTALRM	28
6843412Snewton#define	SVR4_SIGPROF	29
6943412Snewton#define	SVR4_SIGXCPU	30
7043412Snewton#define	SVR4_SIGXFSZ	31
7143412Snewton#define SVR4_NSIG	32
7243412Snewton
7343412Snewton#define	SVR4_SIGNO_MASK		0x00FF
7443412Snewton#define	SVR4_SIGNAL_MASK	0x0000
7543412Snewton#define	SVR4_SIGDEFER_MASK	0x0100
7643412Snewton#define	SVR4_SIGHOLD_MASK	0x0200
7743412Snewton#define	SVR4_SIGRELSE_MASK	0x0400
7843412Snewton#define	SVR4_SIGIGNORE_MASK	0x0800
7943412Snewton#define	SVR4_SIGPAUSE_MASK	0x1000
8043412Snewton
8143412Snewtontypedef void (*svr4_sig_t) __P((int, svr4_siginfo_t *, void *));
8243412Snewton#define	SVR4_SIG_DFL	(svr4_sig_t)	 0
8343412Snewton#define	SVR4_SIG_ERR	(svr4_sig_t)	-1
8443412Snewton#define	SVR4_SIG_IGN	(svr4_sig_t)	 1
8543412Snewton#define	SVR4_SIG_HOLD	(svr4_sig_t)	 2
8643412Snewton
8743412Snewton#define SVR4_SIGNO(a)	((a) & SVR4_SIGNO_MASK)
8843412Snewton#define SVR4_SIGCALL(a) ((a) & ~SVR4_SIGNO_MASK)
8943412Snewton
9043412Snewton#define SVR4_SIG_BLOCK		1
9143412Snewton#define SVR4_SIG_UNBLOCK	2
9243412Snewton#define SVR4_SIG_SETMASK	3
9343412Snewton
9443412Snewtontypedef struct {
9543412Snewton        u_long bits[4];
9643412Snewton} svr4_sigset_t;
9743412Snewton
9843412Snewtonstruct svr4_sigaction {
9948620Scracauer	int		ssa_flags;
10048620Scracauer	svr4_sig_t	ssa_handler;
10148620Scracauer	svr4_sigset_t	ssa_mask;
10248620Scracauer	int 		ssa_reserved[2];
10343412Snewton};
10443412Snewton
10543412Snewtonstruct svr4_sigaltstack {
10643412Snewton	char		*ss_sp;
10743412Snewton	int		ss_size;
10843412Snewton	int		ss_flags;
10943412Snewton};
11043412Snewton
11143412Snewton/* sa_flags */
11243412Snewton#define SVR4_SA_ONSTACK		0x00000001
11343412Snewton#define SVR4_SA_RESETHAND	0x00000002
11443412Snewton#define SVR4_SA_RESTART		0x00000004
11543412Snewton#define SVR4_SA_SIGINFO		0x00000008
11643412Snewton#define SVR4_SA_NODEFER		0x00000010
11743412Snewton#define SVR4_SA_NOCLDWAIT	0x00010000	/* No zombies 	*/
11843412Snewton#define SVR4_SA_NOCLDSTOP	0x00020000	/* No jcl	*/
11943412Snewton#define	SVR4_SA_ALLBITS		0x0003001f
12043412Snewton
12143412Snewton/* ss_flags */
12243412Snewton#define SVR4_SS_ONSTACK		0x00000001
12343412Snewton#define SVR4_SS_DISABLE		0x00000002
12443412Snewton#define	SVR4_SS_ALLBITS		0x00000003
12543412Snewton
12643412Snewtonvoid bsd_to_svr4_sigaltstack __P((const struct sigaltstack *, struct svr4_sigaltstack *));
12743412Snewtonvoid bsd_to_svr4_sigset __P((const sigset_t *, svr4_sigset_t *));
12843412Snewtonvoid svr4_to_bsd_sigaltstack __P((const struct svr4_sigaltstack *, struct sigaltstack *));
12943412Snewtonvoid svr4_to_bsd_sigset __P((const svr4_sigset_t *, sigset_t *));
13043412Snewtonvoid svr4_sendsig(sig_t, int, int, u_long);
13143412Snewton
13243412Snewton#endif /* !_SVR4_SIGNAL_H_ */
133