signal.h revision 174003
1105109Smike/*- 21541Srgrimes * Copyright (c) 1982, 1986, 1989, 1991, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * (c) UNIX System Laboratories, Inc. 51541Srgrimes * All or some portions of this file are derived from material licensed 61541Srgrimes * to the University of California by American Telephone and Telegraph 71541Srgrimes * Co. or Unix System Laboratories, Inc. and are reproduced herein with 81541Srgrimes * the permission of UNIX System Laboratories, Inc. 91541Srgrimes * 101541Srgrimes * Redistribution and use in source and binary forms, with or without 111541Srgrimes * modification, are permitted provided that the following conditions 121541Srgrimes * are met: 131541Srgrimes * 1. Redistributions of source code must retain the above copyright 141541Srgrimes * notice, this list of conditions and the following disclaimer. 151541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 161541Srgrimes * notice, this list of conditions and the following disclaimer in the 171541Srgrimes * documentation and/or other materials provided with the distribution. 181541Srgrimes * 4. Neither the name of the University nor the names of its contributors 191541Srgrimes * may be used to endorse or promote products derived from this software 201541Srgrimes * without specific prior written permission. 211541Srgrimes * 221541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 231541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 241541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 251541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 261541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 271541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 281541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 291541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 301541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 311541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 321541Srgrimes * SUCH DAMAGE. 331541Srgrimes * 3414486Shsu * @(#)signal.h 8.4 (Berkeley) 5/4/95 3550477Speter * $FreeBSD: head/sys/sys/signal.h 174003 2007-11-28 02:11:17Z davidxu $ 361541Srgrimes */ 371541Srgrimes 38105109Smike#ifndef _SYS_SIGNAL_H_ 391541Srgrimes#define _SYS_SIGNAL_H_ 401541Srgrimes 419343Sbde#include <sys/cdefs.h> 42107376Smike#include <sys/_types.h> 4398301Swollman#include <sys/_sigset.h> 449343Sbde 45149337Sstefanf#include <machine/_limits.h> /* __MINSIGSTKSZ */ 46105109Smike#include <machine/signal.h> /* sig_atomic_t; trap codes; sigcontext */ 47105109Smike 4851791Smarcel/* 4951942Smarcel * System defined signals. 5051791Smarcel */ 51105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 5251942Smarcel#define SIGHUP 1 /* hangup */ 53105106Smike#endif 5451791Smarcel#define SIGINT 2 /* interrupt */ 55105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 5651791Smarcel#define SIGQUIT 3 /* quit */ 57105106Smike#endif 5851791Smarcel#define SIGILL 4 /* illegal instr. (not reset when caught) */ 59105106Smike#if __XSI_VISIBLE 6051791Smarcel#define SIGTRAP 5 /* trace trap (not reset when caught) */ 61105106Smike#endif 6251791Smarcel#define SIGABRT 6 /* abort() */ 63105106Smike#if __BSD_VISIBLE 6451791Smarcel#define SIGIOT SIGABRT /* compatibility */ 6551791Smarcel#define SIGEMT 7 /* EMT instruction */ 66105106Smike#endif 6751791Smarcel#define SIGFPE 8 /* floating point exception */ 68105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 6951791Smarcel#define SIGKILL 9 /* kill (cannot be caught or ignored) */ 70105106Smike#endif 71105106Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 7251791Smarcel#define SIGBUS 10 /* bus error */ 73105106Smike#endif 7451791Smarcel#define SIGSEGV 11 /* segmentation violation */ 75105106Smike#if __BSD_VISIBLE 7651791Smarcel#define SIGSYS 12 /* non-existent system call invoked */ 77105106Smike#endif 78105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 7951791Smarcel#define SIGPIPE 13 /* write on a pipe with no one to read it */ 8051791Smarcel#define SIGALRM 14 /* alarm clock */ 81105106Smike#endif 8251791Smarcel#define SIGTERM 15 /* software termination signal from kill */ 83105106Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 8451791Smarcel#define SIGURG 16 /* urgent condition on IO channel */ 85105106Smike#endif 86105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 8751791Smarcel#define SIGSTOP 17 /* sendable stop signal not from tty */ 8851791Smarcel#define SIGTSTP 18 /* stop signal from tty */ 8951791Smarcel#define SIGCONT 19 /* continue a stopped process */ 9051791Smarcel#define SIGCHLD 20 /* to parent on child stop or exit */ 9151791Smarcel#define SIGTTIN 21 /* to readers pgrp upon background tty read */ 9251791Smarcel#define SIGTTOU 22 /* like TTIN if (tp->t_local<OSTOP) */ 93105106Smike#endif 94105106Smike#if __BSD_VISIBLE 9551791Smarcel#define SIGIO 23 /* input/output possible signal */ 96105106Smike#endif 97105106Smike#if __XSI_VISIBLE 9851791Smarcel#define SIGXCPU 24 /* exceeded CPU time limit */ 9951791Smarcel#define SIGXFSZ 25 /* exceeded file size limit */ 10051791Smarcel#define SIGVTALRM 26 /* virtual time alarm */ 10151791Smarcel#define SIGPROF 27 /* profiling time alarm */ 102105106Smike#endif 103105106Smike#if __BSD_VISIBLE 10451942Smarcel#define SIGWINCH 28 /* window size changes */ 10551942Smarcel#define SIGINFO 29 /* information request */ 106105106Smike#endif 107105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 10851942Smarcel#define SIGUSR1 30 /* user defined signal 1 */ 10951942Smarcel#define SIGUSR2 31 /* user defined signal 2 */ 110105106Smike#endif 111112894Sjeff#if __BSD_VISIBLE 112151917Sdavidxu#define SIGTHR 32 /* reserved by thread library. */ 113152373Sdavidxu#define SIGLWP SIGTHR 114112894Sjeff#endif 1151541Srgrimes 116151306Sdavidxu#define SIGRTMIN 65 117152973Sdavidxu#define SIGRTMAX 126 118151306Sdavidxu 119105106Smike#define SIG_DFL ((__sighandler_t *)0) 120105106Smike#define SIG_IGN ((__sighandler_t *)1) 121105106Smike#define SIG_ERR ((__sighandler_t *)-1) 122105106Smike/* 123105106Smike * XXX missing SIG_HOLD. 124105106Smike */ 125105106Smike 1269343Sbde/*- 1279343Sbde * Type of a signal handling function. 1289343Sbde * 1299343Sbde * Language spec sez signal handlers take exactly one arg, even though we 1301541Srgrimes * actually supply three. Ugh! 1319343Sbde * 1329343Sbde * We don't try to hide the difference by leaving out the args because 1339343Sbde * that would cause warnings about conformant programs. Nonconformant 1349343Sbde * programs can avoid the warnings by casting to (__sighandler_t *) or 1359343Sbde * sig_t before calling signal() or assigning to sa_handler or sv_handler. 1369343Sbde * 1379343Sbde * The kernel should reverse the cast before calling the function. It 1389343Sbde * has no way to do this, but on most machines 1-arg and 3-arg functions 1399343Sbde * have the same calling protocol so there is no problem in practice. 1409343Sbde * A bit in sa_flags could be used to specify the number of args. 1411541Srgrimes */ 142105109Smiketypedef void __sighandler_t(int); 1431541Srgrimes 144105015Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 145105015Smike#ifndef _SIGSET_T_DECLARED 146105015Smike#define _SIGSET_T_DECLARED 147105015Smiketypedef __sigset_t sigset_t; 148105015Smike#endif 149105015Smike#endif 150105015Smike 151105015Smike#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE >= 500 15248621Scracauerunion sigval { 15348621Scracauer /* Members as suggested by Annex C of POSIX 1003.1b. */ 154152029Sdavidxu int sival_int; 155152029Sdavidxu void *sival_ptr; 156174003Sdavidxu /* 6.0 compatibility */ 157174003Sdavidxu int sigval_int; 158174003Sdavidxu void *sigval_ptr; 15948621Scracauer}; 160105015Smike#endif 16148621Scracauer 162105015Smike#if __POSIX_VISIBLE >= 199309 16352308Smarcelstruct sigevent { 16452308Smarcel int sigev_notify; /* Notification type */ 165151867Sdavidxu int sigev_signo; /* Signal number */ 166151867Sdavidxu union sigval sigev_value; /* Signal value */ 16769002Salc union { 168151867Sdavidxu __lwpid_t _threadid; 169151867Sdavidxu struct { 170152029Sdavidxu void (*_function)(union sigval); 171151867Sdavidxu void *_attribute; /* pthread_attr_t * */ 172151867Sdavidxu } _sigev_thread; 173153154Sdavidxu long __spare__[8]; 174151867Sdavidxu } _sigev_un; 17552308Smarcel}; 176151867Sdavidxu 177105015Smike#if __BSD_VISIBLE 178151867Sdavidxu#define sigev_notify_kqueue sigev_signo 179151867Sdavidxu#define sigev_notify_thread_id _sigev_un._threadid 180105015Smike#endif 181151867Sdavidxu#define sigev_notify_function _sigev_un._sigev_thread._function 182151867Sdavidxu#define sigev_notify_attributes _sigev_un._sigev_thread._attribute 18352308Smarcel 184151867Sdavidxu#define SIGEV_NONE 0 /* No async notification. */ 185151867Sdavidxu#define SIGEV_SIGNAL 1 /* Generate a queued signal. */ 186151867Sdavidxu#define SIGEV_THREAD 2 /* Call back from another pthread. */ 187105015Smike#if __BSD_VISIBLE 188151867Sdavidxu#define SIGEV_KEVENT 3 /* Generate a kevent. */ 189151867Sdavidxu#define SIGEV_THREAD_ID 4 /* Send signal to a kernel thread. */ 190105015Smike#endif 191105015Smike#endif /* __POSIX_VISIBLE >= 199309 */ 19252308Smarcel 193105015Smike#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE 194105109Smiketypedef struct __siginfo { 19551942Smarcel int si_signo; /* signal number */ 19651942Smarcel int si_errno; /* errno association */ 19752160Smarcel /* 19848621Scracauer * Cause of signal, one of the SI_ macros or signal-specific 199105109Smike * values, i.e. one of the FPE_... values for SIGFPE. This 20048621Scracauer * value is equivalent to the second argument to an old-style 20148621Scracauer * FreeBSD signal handler. 20248621Scracauer */ 20351942Smarcel int si_code; /* signal code */ 204105015Smike __pid_t si_pid; /* sending process */ 205105015Smike __uid_t si_uid; /* sender's ruid */ 20651942Smarcel int si_status; /* exit value */ 20751942Smarcel void *si_addr; /* faulting instruction */ 20851942Smarcel union sigval si_value; /* signal value */ 209151306Sdavidxu union { 210151306Sdavidxu struct { 211151306Sdavidxu int _trapno;/* machine specific trap code */ 212151306Sdavidxu } _fault; 213151574Sdavidxu struct { 214151574Sdavidxu int _timerid; 215151574Sdavidxu int _overrun; 216151574Sdavidxu } _timer; 217153154Sdavidxu struct { 218153154Sdavidxu int _mqd; 219153154Sdavidxu } _mesgq; 220153154Sdavidxu struct { 221153154Sdavidxu long _band; /* band event for SIGPOLL */ 222153154Sdavidxu } _poll; /* was this ever used ? */ 223153154Sdavidxu struct { 224153154Sdavidxu long __spare1__; 225153154Sdavidxu int __spare2__[7]; 226153154Sdavidxu } __spare__; 227151306Sdavidxu } _reason; 22851791Smarcel} siginfo_t; 229151306Sdavidxu 230151306Sdavidxu#define si_trapno _reason._fault._trapno 231151574Sdavidxu#define si_timerid _reason._timer._timerid 232151574Sdavidxu#define si_overrun _reason._timer._overrun 233153154Sdavidxu#define si_mqd _reason._mesgq._mqd 234153154Sdavidxu#define si_band _reason._poll._band 235151306Sdavidxu 236151306Sdavidxu/** si_code **/ 237151306Sdavidxu/* codes for SIGILL */ 238151306Sdavidxu#define ILL_ILLOPC 1 /* Illegal opcode. */ 239151306Sdavidxu#define ILL_ILLOPN 2 /* Illegal operand. */ 240151306Sdavidxu#define ILL_ILLADR 3 /* Illegal addressing mode. */ 241151306Sdavidxu#define ILL_ILLTRP 4 /* Illegal trap. */ 242151306Sdavidxu#define ILL_PRVOPC 5 /* Privileged opcode. */ 243151306Sdavidxu#define ILL_PRVREG 6 /* Privileged register. */ 244151306Sdavidxu#define ILL_COPROC 7 /* Coprocessor error. */ 245151306Sdavidxu#define ILL_BADSTK 8 /* Internal stack error. */ 246151306Sdavidxu 247151306Sdavidxu/* codes for SIGBUS */ 248151306Sdavidxu#define BUS_ADRALN 1 /* Invalid address alignment. */ 249151306Sdavidxu#define BUS_ADRERR 2 /* Nonexistent physical address. */ 250151306Sdavidxu#define BUS_OBJERR 3 /* Object-specific hardware error. */ 251151306Sdavidxu 252151306Sdavidxu/* codes for SIGSEGV */ 253151306Sdavidxu#define SEGV_MAPERR 1 /* Address not mapped to object. */ 254151306Sdavidxu#define SEGV_ACCERR 2 /* Invalid permissions for mapped */ 255151306Sdavidxu /* object. */ 256151306Sdavidxu 257151306Sdavidxu/* codes for SIGFPE */ 258151306Sdavidxu#define FPE_INTOVF 1 /* Integer overflow. */ 259151306Sdavidxu#define FPE_INTDIV 2 /* Integer divide by zero. */ 260151306Sdavidxu#define FPE_FLTDIV 3 /* Floating point divide by zero. */ 261151306Sdavidxu#define FPE_FLTOVF 4 /* Floating point overflow. */ 262151306Sdavidxu#define FPE_FLTUND 5 /* Floating point underflow. */ 263151306Sdavidxu#define FPE_FLTRES 6 /* Floating point inexact result. */ 264151306Sdavidxu#define FPE_FLTINV 7 /* Invalid floating point operation. */ 265151306Sdavidxu#define FPE_FLTSUB 8 /* Subscript out of range. */ 266151306Sdavidxu 267151306Sdavidxu/* codes for SIGTRAP */ 268151306Sdavidxu#define TRAP_BRKPT 1 /* Process breakpoint. */ 269151306Sdavidxu#define TRAP_TRACE 2 /* Process trace trap. */ 270151306Sdavidxu 271151306Sdavidxu/* codes for SIGCHLD */ 272151306Sdavidxu#define CLD_EXITED 1 /* Child has exited */ 273151306Sdavidxu#define CLD_KILLED 2 /* Child has terminated abnormally but */ 274151306Sdavidxu /* did not create a core file */ 275151306Sdavidxu#define CLD_DUMPED 3 /* Child has terminated abnormally and */ 276151306Sdavidxu /* created a core file */ 277151306Sdavidxu#define CLD_TRAPPED 4 /* Traced child has trapped */ 278151306Sdavidxu#define CLD_STOPPED 5 /* Child has stopped */ 279151306Sdavidxu#define CLD_CONTINUED 6 /* Stopped child has continued */ 280151306Sdavidxu 281151306Sdavidxu/* codes for SIGPOLL */ 282151306Sdavidxu#define POLL_IN 1 /* Data input available */ 283151306Sdavidxu#define POLL_OUT 2 /* Output buffers available */ 284151306Sdavidxu#define POLL_MSG 3 /* Input message available */ 285151306Sdavidxu#define POLL_ERR 4 /* I/O Error */ 286151306Sdavidxu#define POLL_PRI 5 /* High priority input available */ 287151306Sdavidxu#define POLL_HUP 4 /* Device disconnected */ 288151306Sdavidxu 289105015Smike#endif 29048621Scracauer 291105106Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 29251942Smarcelstruct __siginfo; 29351942Smarcel 2941541Srgrimes/* 2951541Srgrimes * Signal vector "template" used in sigaction call. 2961541Srgrimes */ 29783045Sobrienstruct sigaction { 29848621Scracauer union { 29992719Salfred void (*__sa_handler)(int); 30092719Salfred void (*__sa_sigaction)(int, struct __siginfo *, void *); 30148621Scracauer } __sigaction_u; /* signal handler */ 30251942Smarcel int sa_flags; /* see signal options below */ 30351942Smarcel sigset_t sa_mask; /* signal mask to apply */ 3041541Srgrimes}; 305108382Smike 306108382Smike#define sa_handler __sigaction_u.__sa_handler 307105015Smike#endif 30851791Smarcel 309105015Smike#if __XSI_VISIBLE 310108402Smike/* If SA_SIGINFO is set, sa_sigaction must be used instead of sa_handler. */ 311105015Smike#define sa_sigaction __sigaction_u.__sa_sigaction 312105015Smike#endif 31351791Smarcel 314105015Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 315105109Smike#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */ 316105015Smike#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ 31751791Smarcel 318105015Smike#if __XSI_VISIBLE 319105109Smike#define SA_ONSTACK 0x0001 /* take signal on signal stack */ 320105109Smike#define SA_RESTART 0x0002 /* restart system call on signal return */ 32114331Speter#define SA_RESETHAND 0x0004 /* reset to SIG_DFL when taking signal */ 32214331Speter#define SA_NODEFER 0x0010 /* don't mask the signal we're delivering */ 32329340Sjoerg#define SA_NOCLDWAIT 0x0020 /* don't keep zombies around */ 32448621Scracauer#define SA_SIGINFO 0x0040 /* signal handler with SA_SIGINFO args */ 325105015Smike#endif 3261541Srgrimes 327105015Smike#if __BSD_VISIBLE 328105109Smike#define NSIG 32 /* number of old signals (counting 0) */ 329105015Smike#endif 3301541Srgrimes 331105015Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 332153228Sdavidxu#define SI_NOINFO 0 /* No signal info besides si_signo. */ 333151306Sdavidxu#define SI_USER 0x10001 /* Signal sent by kill(). */ 334151306Sdavidxu#define SI_QUEUE 0x10002 /* Signal sent by the sigqueue(). */ 335151306Sdavidxu#define SI_TIMER 0x10003 /* Signal generated by expiration of */ 336151306Sdavidxu /* a timer set by timer_settime(). */ 337151306Sdavidxu#define SI_ASYNCIO 0x10004 /* Signal generated by completion of */ 338151306Sdavidxu /* an asynchronous I/O request.*/ 339151306Sdavidxu#define SI_MESGQ 0x10005 /* Signal generated by arrival of a */ 340151306Sdavidxu /* message on an empty message queue. */ 341105015Smike#endif 342105015Smike#if __BSD_VISIBLE 343105109Smike#define SI_UNDEFINED 0 344105015Smike#endif 34551791Smarcel 346105106Smike#if __BSD_VISIBLE 3479343Sbdetypedef __sighandler_t *sig_t; /* type of pointer to a signal function */ 348105106Smiketypedef void __siginfohandler_t(int, struct __siginfo *, void *); 349105106Smike#endif 3501541Srgrimes 351105015Smike#if __XSI_VISIBLE 3521541Srgrimes/* 35351942Smarcel * Structure used in sigaltstack call. 3541541Srgrimes */ 355105015Smike#if __BSD_VISIBLE 356105015Smiketypedef struct sigaltstack { 357105015Smike#else 358105015Smiketypedef struct { 359105015Smike#endif 36051942Smarcel char *ss_sp; /* signal stack base */ 361105015Smike __size_t ss_size; /* signal stack length */ 36251942Smarcel int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */ 36351791Smarcel} stack_t; 36451791Smarcel 36514331Speter#define SS_ONSTACK 0x0001 /* take signal on alternate stack */ 36614331Speter#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ 367149337Sstefanf#define MINSIGSTKSZ __MINSIGSTKSZ /* minimum stack size */ 3681541Srgrimes#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ 369105015Smike#endif 3701541Srgrimes 371105015Smike#if __BSD_VISIBLE 37251791Smarcel/* 3731541Srgrimes * 4.3 compatibility: 3741541Srgrimes * Signal vector "template" used in sigvec call. 3751541Srgrimes */ 37683045Sobrienstruct sigvec { 37751942Smarcel __sighandler_t *sv_handler; /* signal handler */ 37851942Smarcel int sv_mask; /* signal mask to apply */ 37951942Smarcel int sv_flags; /* see signal options below */ 3801541Srgrimes}; 3811541Srgrimes 382105109Smike#define SV_ONSTACK SA_ONSTACK 383105109Smike#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */ 384105109Smike#define SV_RESETHAND SA_RESETHAND 385105109Smike#define SV_NODEFER SA_NODEFER 386105109Smike#define SV_NOCLDSTOP SA_NOCLDSTOP 387105109Smike#define SV_SIGINFO SA_SIGINFO 388105109Smike#define sv_onstack sv_flags /* isn't compatibility wonderful! */ 389105015Smike#endif 3901541Srgrimes 391105950Speter/* Keep this in one place only */ 392105950Speter#if defined(_KERNEL) && defined(COMPAT_43) && \ 393158471Sjhb !defined(__i386__) 394105950Speterstruct osigcontext { 395105950Speter int _not_used; 396105950Speter}; 397105950Speter#endif 398105950Speter 399105015Smike#if __XSI_VISIBLE 4001541Srgrimes/* 4011541Srgrimes * Structure used in sigstack call. 4021541Srgrimes */ 40383045Sobrienstruct sigstack { 404105015Smike /* XXX ss_sp's type should be `void *'. */ 40551942Smarcel char *ss_sp; /* signal stack pointer */ 40651942Smarcel int ss_onstack; /* current status */ 4071541Srgrimes}; 408105015Smike#endif 4091541Srgrimes 410105015Smike#if __BSD_VISIBLE || __POSIX_VISIBLE > 0 && __POSIX_VISIBLE <= 200112 4111541Srgrimes/* 4121541Srgrimes * Macro for converting signal number to a mask suitable for 4131541Srgrimes * sigblock(). 4141541Srgrimes */ 415105109Smike#define sigmask(m) (1 << ((m)-1)) 416105015Smike#endif 4171541Srgrimes 418105015Smike#if __BSD_VISIBLE 4191541Srgrimes#define BADSIG SIG_ERR 420105015Smike#endif 4211541Srgrimes 422105015Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 42351791Smarcel/* 42451791Smarcel * Flags for sigprocmask: 42551791Smarcel */ 42651791Smarcel#define SIG_BLOCK 1 /* block specified signal set */ 42751791Smarcel#define SIG_UNBLOCK 2 /* unblock specified signal set */ 42851791Smarcel#define SIG_SETMASK 3 /* set specified signal set */ 429105015Smike#endif 43034925Sdufault 4311541Srgrimes/* 4321541Srgrimes * For historical reasons; programs expect signal's return value to be 4331541Srgrimes * defined by <sys/signal.h>. 4341541Srgrimes */ 4351541Srgrimes__BEGIN_DECLS 43692719Salfred__sighandler_t *signal(int, __sighandler_t *); 4371541Srgrimes__END_DECLS 4389343Sbde 439105109Smike#endif /* !_SYS_SIGNAL_H_ */ 440