signal.h (38121) | signal.h (48621) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)signal.h 8.4 (Berkeley) 5/4/95 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)signal.h 8.4 (Berkeley) 5/4/95 |
39 * $Id: signal.h,v 1.13 1998/03/28 11:50:43 dufault Exp $ | 39 * $Id: signal.h,v 1.14 1998/08/05 09:04:36 dfr Exp $ |
40 */ 41 42#ifndef _SYS_SIGNAL_H_ 43#define _SYS_SIGNAL_H_ 44 45#include <sys/cdefs.h> 46#include <sys/_posix.h> 47#include <machine/signal.h> /* sig_atomic_t; trap codes; sigcontext */ --- 60 unchanged lines hidden (view full) --- 108 * 109 * The kernel should reverse the cast before calling the function. It 110 * has no way to do this, but on most machines 1-arg and 3-arg functions 111 * have the same calling protocol so there is no problem in practice. 112 * A bit in sa_flags could be used to specify the number of args. 113 */ 114typedef void __sighandler_t __P((int)); 115 | 40 */ 41 42#ifndef _SYS_SIGNAL_H_ 43#define _SYS_SIGNAL_H_ 44 45#include <sys/cdefs.h> 46#include <sys/_posix.h> 47#include <machine/signal.h> /* sig_atomic_t; trap codes; sigcontext */ --- 60 unchanged lines hidden (view full) --- 108 * 109 * The kernel should reverse the cast before calling the function. It 110 * has no way to do this, but on most machines 1-arg and 3-arg functions 111 * have the same calling protocol so there is no problem in practice. 112 * A bit in sa_flags could be used to specify the number of args. 113 */ 114typedef void __sighandler_t __P((int)); 115 |
116#if defined(_P1003_1B_VISIBLE_HISTORICALLY) || \ 117 (!defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)) 118union sigval { 119 /* Members as suggested by Annex C of POSIX 1003.1b. */ 120 int sigval_int; 121 void *sigval_ptr; 122}; 123#endif /* !_ANSI_SOURCE && _P1003_1B_VISIBLE_HISTORICALLY */ 124 125#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 126/* POSIX 1003.1b required values. */ 127#define SI_USER 0x10001 128#define SI_QUEUE 0x10002 129#define SI_TIMER 0x10003 130#define SI_ASYNCIO 0x10004 131#define SI_MESGQ 0x10005 132 133/* Additional FreeBSD values. */ 134#define SI_UNDEFINED 0 135 136struct __siginfo { 137 struct sigcontext si_sc; 138 int si_signo; /* signal number */ 139 140 /* 141 * Cause of signal, one of the SI_ macros or signal-specific 142 * values, i.e. one of the FPE_... values for SIGFPE. This 143 * value is equivalent to the second argument to an old-style 144 * FreeBSD signal handler. 145 */ 146 int si_code; 147 148 union sigval si_value; 149}; 150#else /* ! _ANSI_SOURCE && ! _POSIX_SOURCE */ 151struct __siginfo; 152#endif /* ! _ANSI_SOURCE && ! _POSIX_SOURCE */ 153 154typedef struct __siginfo siginfo_t; 155 156#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) 157typedef void __siginfohandler_t __P((int, siginfo_t *, void *)); 158#endif /* ! _ANSI_SOURCE && ! _POSIX_SOURCE */ 159 |
|
116#define SIG_DFL ((__sighandler_t *)0) 117#define SIG_IGN ((__sighandler_t *)1) 118#define SIG_ERR ((__sighandler_t *)-1) 119 120#ifndef _ANSI_SOURCE 121typedef unsigned int sigset_t; 122 123/* 124 * Signal vector "template" used in sigaction call. 125 */ 126struct sigaction { | 160#define SIG_DFL ((__sighandler_t *)0) 161#define SIG_IGN ((__sighandler_t *)1) 162#define SIG_ERR ((__sighandler_t *)-1) 163 164#ifndef _ANSI_SOURCE 165typedef unsigned int sigset_t; 166 167/* 168 * Signal vector "template" used in sigaction call. 169 */ 170struct sigaction { |
127 __sighandler_t *sa_handler; /* signal handler */ | 171 union { 172 void (*__sa_handler) __P((int)); 173 void (*__sa_sigaction) __P((int, siginfo_t *, void *)); 174 } __sigaction_u; /* signal handler */ |
128 sigset_t sa_mask; /* signal mask to apply */ 129 int sa_flags; /* see signal options below */ 130}; | 175 sigset_t sa_mask; /* signal mask to apply */ 176 int sa_flags; /* see signal options below */ 177}; |
178/* if SA_SIGINFO is set, sa_sigaction is to be used instead of sa_handler. */ 179#define sa_handler __sigaction_u.__sa_handler |
|
131#ifndef _POSIX_SOURCE | 180#ifndef _POSIX_SOURCE |
181#define sa_sigaction __sigaction_u.__sa_sigaction 182#endif 183 184#ifndef _POSIX_SOURCE |
|
132#define SA_ONSTACK 0x0001 /* take signal on signal stack */ 133#define SA_RESTART 0x0002 /* restart system call on signal return */ 134#define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ 135#define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ 136#define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ | 185#define SA_ONSTACK 0x0001 /* take signal on signal stack */ 186#define SA_RESTART 0x0002 /* restart system call on signal return */ 187#define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ 188#define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ 189#define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ |
190#define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */ |
|
137#ifdef COMPAT_SUNOS 138#define SA_USERTRAMP 0x0100 /* do not bounce off kernel's sigtramp */ 139#endif 140#endif /* _POSIX_SOURCE */ 141#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ 142 143/* 144 * Flags for sigprocmask: --- 33 unchanged lines hidden (view full) --- 178 int sv_flags; /* see signal options below */ 179}; 180 181#define SV_ONSTACK SA_ONSTACK 182#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */ 183#define SV_RESETHAND SA_RESETHAND 184#define SV_NODEFER SA_NODEFER 185#define SV_NOCLDSTOP SA_NOCLDSTOP | 191#ifdef COMPAT_SUNOS 192#define SA_USERTRAMP 0x0100 /* do not bounce off kernel's sigtramp */ 193#endif 194#endif /* _POSIX_SOURCE */ 195#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ 196 197/* 198 * Flags for sigprocmask: --- 33 unchanged lines hidden (view full) --- 232 int sv_flags; /* see signal options below */ 233}; 234 235#define SV_ONSTACK SA_ONSTACK 236#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */ 237#define SV_RESETHAND SA_RESETHAND 238#define SV_NODEFER SA_NODEFER 239#define SV_NOCLDSTOP SA_NOCLDSTOP |
240#define SV_SIGINFO SA_SIGINFO |
|
186#define sv_onstack sv_flags /* isn't compatibility wonderful! */ 187 188/* 189 * Structure used in sigstack call. 190 */ 191struct sigstack { 192 char *ss_sp; /* signal stack pointer */ 193 int ss_onstack; /* current status */ --- 5 unchanged lines hidden (view full) --- 199 */ 200#define sigmask(m) (1 << ((m)-1)) 201 202#define BADSIG SIG_ERR 203 204#endif /* !_POSIX_SOURCE */ 205#endif /* !_ANSI_SOURCE */ 206 | 241#define sv_onstack sv_flags /* isn't compatibility wonderful! */ 242 243/* 244 * Structure used in sigstack call. 245 */ 246struct sigstack { 247 char *ss_sp; /* signal stack pointer */ 248 int ss_onstack; /* current status */ --- 5 unchanged lines hidden (view full) --- 254 */ 255#define sigmask(m) (1 << ((m)-1)) 256 257#define BADSIG SIG_ERR 258 259#endif /* !_POSIX_SOURCE */ 260#endif /* !_ANSI_SOURCE */ 261 |
207#ifdef _P1003_1B_VISIBLE_HISTORICALLY | 262#if !defined(_ANSI_SOURCE) && defined(_P1003_1B_VISIBLE_HISTORICALLY) |
208 | 263 |
209/* sys/aio.h unconditionally defined these */ 210 211union sigval { 212 int sival_int; /* Integer signal value */ 213 void *sival_ptr; /* Pointer signal value */ 214}; 215 216typedef struct siginfo { 217 int si_signo; /* Signal number */ 218 int si_code; /* Cause of the signal */ 219 union sigval si_value; /* Signal value */ 220} siginfo_t; 221 | |
222struct sigevent { 223 int sigev_notify; /* Notification type */ 224 int sigev_signo; /* Signal number */ 225 union sigval sigev_value; /* Signal value */ 226}; 227 228#define SIGEV_NONE 0 /* No async notification */ 229#define SIGEV_SIGNAL 1 /* Generate a queued signal */ 230 | 264struct sigevent { 265 int sigev_notify; /* Notification type */ 266 int sigev_signo; /* Signal number */ 267 union sigval sigev_value; /* Signal value */ 268}; 269 270#define SIGEV_NONE 0 /* No async notification */ 271#define SIGEV_SIGNAL 1 /* Generate a queued signal */ 272 |
231#endif | 273#endif /* ! _ANSI_SOURCE && _P1003_1B_VISIBLE_HISTORICALLY */ |
232 233/* 234 * For historical reasons; programs expect signal's return value to be 235 * defined by <sys/signal.h>. 236 */ 237__BEGIN_DECLS 238__sighandler_t *signal __P((int, __sighandler_t *)); 239__END_DECLS 240 241#endif /* !_SYS_SIGNAL_H_ */ | 274 275/* 276 * For historical reasons; programs expect signal's return value to be 277 * defined by <sys/signal.h>. 278 */ 279__BEGIN_DECLS 280__sighandler_t *signal __P((int, __sighandler_t *)); 281__END_DECLS 282 283#endif /* !_SYS_SIGNAL_H_ */ |