linux_signal.h revision 1.1 1 /* $NetBSD: linux_signal.h,v 1.1 2005/05/03 16:26:30 manu Exp $ */
2
3 /*-
4 * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software
15 * must display the following acknowledgement:
16 * This product includes software developed by Emmanuel Dreyfus
17 * 4. The name of the author may not be used to endorse or promote
18 * products derived from this software without specific prior written
19 * permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE THE AUTHOR AND CONTRIBUTORS ``AS IS''
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
25 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34 #ifndef _AMD64_LINUX_SIGNAL_H
35 #define _AMD64_LINUX_SIGNAL_H
36
37 #define LINUX_SIGHUP 1
38 #define LINUX_SIGINT 2
39 #define LINUX_SIGQUIT 3
40 #define LINUX_SIGILL 4
41 #define LINUX_SIGTRAP 5
42 #define LINUX_SIGABRT 6
43 #define LINUX_SIGIOT 6
44 #define LINUX_SIGBUS 7
45 #define LINUX_SIGFPE 8
46 #define LINUX_SIGKILL 9
47 #define LINUX_SIGUSR1 10
48 #define LINUX_SIGSEGV 11
49 #define LINUX_SIGUSR2 12
50 #define LINUX_SIGPIPE 13
51 #define LINUX_SIGALRM 14
52 #define LINUX_SIGTERM 15
53 #define LINUX_SIGSTKFLT 16
54 #define LINUX_SIGCHLD 17
55 #define LINUX_SIGCONT 18
56 #define LINUX_SIGSTOP 19
57 #define LINUX_SIGTSTP 20
58 #define LINUX_SIGTTIN 21
59 #define LINUX_SIGTTOU 22
60 #define LINUX_SIGURG 23
61 #define LINUX_SIGXCPU 24
62 #define LINUX_SIGXFSZ 25
63 #define LINUX_SIGVTALRM 26
64 #define LINUX_SIGPROF 27
65 #define LINUX_SIGWINCH 28
66 #define LINUX_SIGIO 29
67 #define LINUX_SIGPWR 30
68 #define LINUX_SIGSYS 31
69 #define LINUX_SIGRTMIN 32
70 #define LINUX_SIGRTMAX LINUX__NSIG
71
72
73 #define LINUX_SS_ONSTACK 1
74 #define LINUX_SS_DISABLE 2
75
76 #define LINUX_SA_NOCLDSTOP 0x00000001
77 #define LINUX_SA_NOCLDWAIT 0x00000002
78 #define LINUX_SA_SIGINFO 0x00000004
79 #define LINUX_SA_ONSTACK 0x08000000
80 #define LINUX_SA_RESTART 0x10000000
81 #define LINUX_SA_NOMASK 0x40000000
82 #define LINUX_SA_ONESHOT 0x80000000
83 #define LINUX_SA_ALLBITS 0xd8000007
84
85 #define LINUX_SIG_BLOCK 0
86 #define LINUX_SIG_UNBLOCK 1
87 #define LINUX_SIG_SETMASK 2
88
89 #define LINUX__NSIG 64
90 #define LINUX__NSIG_BPW 64
91 #define LINUX__NSIG_WORDS (LINUX__NSIG / LINUX__NSIG_BPW)
92
93 typedef unsigned int linux_old_sigset_t;
94
95 typedef struct {
96 unsigned long sig[LINUX__NSIG_WORDS];
97 } linux_sigset_t;
98
99 typedef void (*linux_handler_t)(int);
100
101 /* struct old_sigaction32 in Linux; uses a 32 bit pointer for handlers */
102 struct linux_compat_old_sigaction {
103 int linux_sa_handler;
104 linux_old_sigset_t linux_sa_mask;
105 unsigned int linux_sa_flags;
106 int linux_sa_restorer;
107 };
108
109 /* Dummy declaration to avoid errors, unused */
110 struct linux_old_sigaction {
111 linux_handler_t linux_sa_handler;
112 unsigned long linux_sa_flags;
113 linux_handler_t linux_sa_restorer;
114 linux_sigset_t linux_sa_mask;
115 };
116
117 struct linux_sigaction {
118 linux_handler_t linux_sa_handler;
119 unsigned long linux_sa_flags;
120 linux_handler_t linux_sa_restorer;
121 linux_sigset_t linux_sa_mask;
122 };
123
124 typedef struct linux_sigaltstack {
125 void *ss_sp;
126 int ss_flags;
127 size_t ss_size;
128 } linux_stack_t;
129
130 #endif /* !_AMD64_LINUX_SIGNAL_H */
131