1 /* $OpenBSD: ibcs2_signal.h,v 1.5 2002/03/14 01:26:50 millert Exp $ */
2 /* $NetBSD: ibcs2_signal.h,v 1.8 1996/05/03 17:05:28 christos Exp $ */
3
4 /*
5 * Copyright (c) 1994, 1995 Scott Bartram
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by Scott Bartram.
19 * 4. The name of the author may not be used to endorse or promote products
20 * derived from this software without specific prior written permission
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef _IBCS2_SIGNAL_H
35 #define _IBCS2_SIGNAL_H
36
37 #define IBCS2_SIGHUP 1
38 #define IBCS2_SIGINT 2
39 #define IBCS2_SIGQUIT 3
40 #define IBCS2_SIGILL 4
41 #define IBCS2_SIGTRAP 5
42 #define IBCS2_SIGIOT 6
43 #define IBCS2_SIGABRT 6
44 #define IBCS2_SIGEMT 7
45 #define IBCS2_SIGFPE 8
46 #define IBCS2_SIGKILL 9
47 #define IBCS2_SIGBUS 10
48 #define IBCS2_SIGSEGV 11
49 #define IBCS2_SIGSYS 12
50 #define IBCS2_SIGPIPE 13
51 #define IBCS2_SIGALRM 14
52 #define IBCS2_SIGTERM 15
53 #define IBCS2_SIGUSR1 16
54 #define IBCS2_SIGUSR2 17
55 #define IBCS2_SIGCLD 18
56 #define IBCS2_SIGPWR 19
57 #define IBCS2_SIGWINCH 20
58 #define IBCS2_SIGPOLL 22
59 #define IBCS2_NSIG 32
60
61 /*
62 * SCO-specific
63 */
64 #define IBCS2_SIGSTOP 23
65 #define IBCS2_SIGTSTP 24
66 #define IBCS2_SIGCONT 25
67 #define IBCS2_SIGTTIN 26
68 #define IBCS2_SIGTTOU 27
69 #define IBCS2_SIGVTALRM 28
70 #define IBCS2_SIGPROF 29
71
72 #define IBCS2_SIGNO_MASK 0x00FF
73 #define IBCS2_SIGNAL_MASK 0x0000
74 #define IBCS2_SIGSET_MASK 0x0100
75 #define IBCS2_SIGHOLD_MASK 0x0200
76 #define IBCS2_SIGRELSE_MASK 0x0400
77 #define IBCS2_SIGIGNORE_MASK 0x0800
78 #define IBCS2_SIGPAUSE_MASK 0x1000
79
80 #define IBCS2_SIGNO(x) ((x) & IBCS2_SIGNO_MASK)
81 #define IBCS2_SIGCALL(x) ((x) & ~IBCS2_SIGNO_MASK)
82
83 #define IBCS2_SIG_DFL (void(*)(int)) 0
84 #define IBCS2_SIG_ERR (void(*)(int)) -1
85 #define IBCS2_SIG_IGN (void(*)(int)) 1
86 #define IBCS2_SIG_HOLD (void(*)(int)) 2
87
88 #define IBCS2_SIG_SETMASK 0
89 #define IBCS2_SIG_BLOCK 1
90 #define IBCS2_SIG_UNBLOCK 2
91
92 typedef long ibcs2_sigset_t;
93 typedef void (*ibcs2_sig_t)(int);
94
95 struct ibcs2_sigaction {
96 ibcs2_sig_t sa__handler;
97 ibcs2_sigset_t sa_mask;
98 int sa_flags;
99 };
100
101 /* sa_flags */
102 #define IBCS2_SA_NOCLDSTOP 1
103
104 extern int bsd_to_ibcs2_sig[];
105
106 #endif /* _IBCS2_SIGNAL_H */