| 1 | /** @file | 
|---|
| 2 | * FreeBSD 5.1 | 
|---|
| 3 | * @changed bird:   Added sighold(), sigignore(), sigrelse(). Added wrapper | 
|---|
| 4 | *                  between the two sigpause() APIs. | 
|---|
| 5 | * @changed bird:   include sys/timespec.h. | 
|---|
| 6 | */ | 
|---|
| 7 |  | 
|---|
| 8 | /*- | 
|---|
| 9 | * Copyright (c) 1991, 1993 | 
|---|
| 10 | *      The Regents of the University of California.  All rights reserved. | 
|---|
| 11 | * | 
|---|
| 12 | * Redistribution and use in source and binary forms, with or without | 
|---|
| 13 | * modification, are permitted provided that the following conditions | 
|---|
| 14 | * are met: | 
|---|
| 15 | * 1. Redistributions of source code must retain the above copyright | 
|---|
| 16 | *    notice, this list of conditions and the following disclaimer. | 
|---|
| 17 | * 2. Redistributions in binary form must reproduce the above copyright | 
|---|
| 18 | *    notice, this list of conditions and the following disclaimer in the | 
|---|
| 19 | *    documentation and/or other materials provided with the distribution. | 
|---|
| 20 | * 3. All advertising materials mentioning features or use of this software | 
|---|
| 21 | *    must display the following acknowledgement: | 
|---|
| 22 | *      This product includes software developed by the University of | 
|---|
| 23 | *      California, Berkeley and its contributors. | 
|---|
| 24 | * 4. Neither the name of the University nor the names of its contributors | 
|---|
| 25 | *    may be used to endorse or promote products derived from this software | 
|---|
| 26 | *    without specific prior written permission. | 
|---|
| 27 | * | 
|---|
| 28 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | 
|---|
| 29 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 
|---|
| 30 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 
|---|
| 31 | * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 
|---|
| 32 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 
|---|
| 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 
|---|
| 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 
|---|
| 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 
|---|
| 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 
|---|
| 37 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 
|---|
| 38 | * SUCH DAMAGE. | 
|---|
| 39 | * | 
|---|
| 40 | *      @(#)signal.h    8.3 (Berkeley) 3/30/94 | 
|---|
| 41 | * $FreeBSD: src/include/signal.h,v 1.24 2003/03/31 23:30:41 jeff Exp $ | 
|---|
| 42 | */ | 
|---|
| 43 |  | 
|---|
| 44 | #ifndef _SIGNAL_H_ | 
|---|
| 45 | #define _SIGNAL_H_ | 
|---|
| 46 |  | 
|---|
| 47 | #include <sys/cdefs.h> | 
|---|
| 48 | #include <sys/_types.h> | 
|---|
| 49 | #include <sys/signal.h> | 
|---|
| 50 | #include <sys/timespec.h>               /* bird: Need full timespec declaration. */ | 
|---|
| 51 |  | 
|---|
| 52 | #if __BSD_VISIBLE | 
|---|
| 53 | /* | 
|---|
| 54 | * XXX should enlarge these, if only to give empty names instead of bounds | 
|---|
| 55 | * errors for large signal numbers. | 
|---|
| 56 | */ | 
|---|
| 57 | extern __const char *__const sys_signame[NSIG]; | 
|---|
| 58 | extern __const char *__const sys_siglist[NSIG]; | 
|---|
| 59 | extern __const int sys_nsig; | 
|---|
| 60 | #endif | 
|---|
| 61 |  | 
|---|
| 62 | #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE | 
|---|
| 63 | #ifndef _PID_T_DECLARED | 
|---|
| 64 | typedef __pid_t         pid_t; | 
|---|
| 65 | #define _PID_T_DECLARED | 
|---|
| 66 | #endif | 
|---|
| 67 | #endif | 
|---|
| 68 |  | 
|---|
| 69 | __BEGIN_DECLS | 
|---|
| 70 | int     raise(int); | 
|---|
| 71 |  | 
|---|
| 72 | #if __POSIX_VISIBLE || __XSI_VISIBLE | 
|---|
| 73 | int     kill(__pid_t, int); | 
|---|
| 74 | int     sigaction(int, const struct sigaction * __restrict, | 
|---|
| 75 | struct sigaction * __restrict); | 
|---|
| 76 | int     sigaddset(sigset_t *, int); | 
|---|
| 77 | int     sigdelset(sigset_t *, int); | 
|---|
| 78 | int     sigemptyset(sigset_t *); | 
|---|
| 79 | int     sigfillset(sigset_t *); | 
|---|
| 80 | int     sigismember(const sigset_t *, int); | 
|---|
| 81 | int     sigpending(sigset_t *); | 
|---|
| 82 | int     sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); | 
|---|
| 83 | int     sigsuspend(const sigset_t *); | 
|---|
| 84 | int     sigwait(const sigset_t * __restrict, int * __restrict); | 
|---|
| 85 | #endif | 
|---|
| 86 |  | 
|---|
| 87 | #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 | 
|---|
| 88 | #if 0 | 
|---|
| 89 | /* | 
|---|
| 90 | * PR: 35924 | 
|---|
| 91 | * XXX we don't actually have these.  We set _POSIX_REALTIME_SIGNALS to | 
|---|
| 92 | * -1 to show that we don't have them, but this symbol is not necessarily | 
|---|
| 93 | * in scope (in the current implementation), so we can't use it here. | 
|---|
| 94 | */ | 
|---|
| 95 | #endif /* bird we do */ | 
|---|
| 96 | int     sigqueue(__pid_t, int, const union sigval); | 
|---|
| 97 | struct timespec; | 
|---|
| 98 | int     sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict, | 
|---|
| 99 | const struct timespec * __restrict); | 
|---|
| 100 | int     sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict); | 
|---|
| 101 | #endif | 
|---|
| 102 |  | 
|---|
| 103 | #if __XSI_VISIBLE | 
|---|
| 104 | int     killpg(__pid_t, int); | 
|---|
| 105 | int     sigaltstack(const stack_t * __restrict, stack_t * __restrict); | 
|---|
| 106 | int     sigpause(int); | 
|---|
| 107 | #endif | 
|---|
| 108 |  | 
|---|
| 109 | #if __POSIX_VISIBLE >= 200112 | 
|---|
| 110 | int     siginterrupt(int, int); | 
|---|
| 111 | #endif | 
|---|
| 112 |  | 
|---|
| 113 | #if __BSD_VISIBLE | 
|---|
| 114 | int     sigblock(int); | 
|---|
| 115 | struct __ucontext;              /* XXX spec requires a complete declaration. */ | 
|---|
| 116 | int     sigreturn(const struct __ucontext *); | 
|---|
| 117 | int     sigsetmask(int); | 
|---|
| 118 | int     sigstack(const struct sigstack *, struct sigstack *); | 
|---|
| 119 | int     sigvec(int, struct sigvec *, struct sigvec *); | 
|---|
| 120 | void    psignal(unsigned int, const char *); | 
|---|
| 121 | #endif | 
|---|
| 122 |  | 
|---|
| 123 | /* bird: standard call which BSD doesn't prototype. */ | 
|---|
| 124 | #if __XSI_VISIBLE | 
|---|
| 125 | int     sighold(int); | 
|---|
| 126 | int     sigignore(int); | 
|---|
| 127 | int     sigrelse(int); | 
|---|
| 128 | void  (*sigset(int, void (*)(int)))(int); | 
|---|
| 129 | #endif | 
|---|
| 130 | #if __BSD_VISIBLE && !defined(_XOPEN_SOURCE) && !defined(sigpause) | 
|---|
| 131 | int     __sigpause_bsd(int); | 
|---|
| 132 | #define sigpause(mask) __sigpause_bsd(mask) | 
|---|
| 133 | #endif | 
|---|
| 134 | /* bird: end */ | 
|---|
| 135 |  | 
|---|
| 136 | __END_DECLS | 
|---|
| 137 |  | 
|---|
| 138 | #endif /* !_SIGNAL_H_ */ | 
|---|
| 139 |  | 
|---|