signal.h revision 200881
11539Srgrimes/*- 21539Srgrimes * Copyright (c) 1991, 1993 31539Srgrimes * The Regents of the University of California. All rights reserved. 41539Srgrimes * 51539Srgrimes * Redistribution and use in source and binary forms, with or without 61539Srgrimes * modification, are permitted provided that the following conditions 71539Srgrimes * are met: 81539Srgrimes * 1. Redistributions of source code must retain the above copyright 91539Srgrimes * notice, this list of conditions and the following disclaimer. 101539Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111539Srgrimes * notice, this list of conditions and the following disclaimer in the 121539Srgrimes * documentation and/or other materials provided with the distribution. 131539Srgrimes * 3. All advertising materials mentioning features or use of this software 141539Srgrimes * must display the following acknowledgement: 151539Srgrimes * This product includes software developed by the University of 161539Srgrimes * California, Berkeley and its contributors. 171539Srgrimes * 4. Neither the name of the University nor the names of its contributors 181539Srgrimes * may be used to endorse or promote products derived from this software 191539Srgrimes * without specific prior written permission. 201539Srgrimes * 211539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241539Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 281539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 291539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311539Srgrimes * SUCH DAMAGE. 321539Srgrimes * 331539Srgrimes * @(#)signal.h 8.3 (Berkeley) 3/30/94 3451794Smarcel * $FreeBSD: head/include/signal.h 200881 2009-12-22 22:15:52Z cognet $ 351539Srgrimes */ 361539Srgrimes 379343Sbde#ifndef _SIGNAL_H_ 389343Sbde#define _SIGNAL_H_ 391539Srgrimes 401539Srgrimes#include <sys/cdefs.h> 41102227Smike#include <sys/_types.h> 421539Srgrimes#include <sys/signal.h> 431539Srgrimes 44104582Smike#if __BSD_VISIBLE 45105107Smike/* 46105107Smike * XXX should enlarge these, if only to give empty names instead of bounds 47105107Smike * errors for large signal numbers. 48105107Smike */ 491539Srgrimesextern __const char *__const sys_signame[NSIG]; 501539Srgrimesextern __const char *__const sys_siglist[NSIG]; 5147289Speterextern __const int sys_nsig; 521539Srgrimes#endif 531539Srgrimes 54105013Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 55104582Smike#ifndef _PID_T_DECLARED 56104582Smiketypedef __pid_t pid_t; 57104582Smike#define _PID_T_DECLARED 58104582Smike#endif 59104582Smike#endif 60104582Smike 61189828Sdas#if __POSIX_VISIBLE || __XSI_VISIBLE 62189828Sdasstruct pthread; /* XXX */ 63189828Sdastypedef struct pthread *__pthread_t; 64189828Sdas#if !defined(_PTHREAD_T_DECLARED) && __POSIX_VISIBLE >= 200809 65189828Sdastypedef __pthread_t pthread_t; 66189828Sdas#define _PTHREAD_T_DECLARED 67189828Sdas#endif 68189828Sdas#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ 69189828Sdas 701539Srgrimes__BEGIN_DECLS 7193032Simpint raise(int); 72104582Smike 73105013Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 74102227Smikeint kill(__pid_t, int); 75189828Sdasint pthread_kill(__pthread_t, int); 76189828Sdasint pthread_sigmask(int, const __sigset_t *, __sigset_t *); 77104368Srobertint sigaction(int, const struct sigaction * __restrict, 78104368Srobert struct sigaction * __restrict); 7993032Simpint sigaddset(sigset_t *, int); 8093032Simpint sigdelset(sigset_t *, int); 8193032Simpint sigemptyset(sigset_t *); 8293032Simpint sigfillset(sigset_t *); 8393032Simpint sigismember(const sigset_t *, int); 8493032Simpint sigpending(sigset_t *); 85104368Srobertint sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); 8693032Simpint sigsuspend(const sigset_t *); 87104989Smikeint sigwait(const sigset_t * __restrict, int * __restrict); 88104582Smike#endif 8934319Sdufault 90105013Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 91151395Sdavidxuint sigqueue(__pid_t, int, const union sigval); 92151318Sdavidxu 93105107Smikestruct timespec; 94104582Smikeint sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict, 95104368Srobert const struct timespec * __restrict); 96104582Smikeint sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict); 97104582Smike#endif 9834319Sdufault 99105013Smike#if __XSI_VISIBLE 100102227Smikeint killpg(__pid_t, int); 101104368Srobertint sigaltstack(const stack_t * __restrict, stack_t * __restrict); 102200881Scognetint sighold(int); 103200881Scognetint sigignore(int); 104200881Scognetint sigpause(int); 105200881Scognetint sigrelse(int); 106200881Scognetvoid (*sigset(int, void (*)(int)))(int); 107200881Scognetint xsi_sigpause(int); 108104582Smike#endif 109104582Smike 110189828Sdas#if __XSI_VISIBLE >= 600 111105013Smikeint siginterrupt(int, int); 112105013Smike#endif 113105013Smike 114189352Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 115189352Sdasvoid psignal(unsigned int, const char *); 116189352Sdas#endif 117189352Sdas 118104582Smike#if __BSD_VISIBLE 119104582Smikeint sigblock(int); 120105107Smikestruct __ucontext; /* XXX spec requires a complete declaration. */ 12193032Simpint sigreturn(const struct __ucontext *); 12293032Simpint sigsetmask(int); 12393032Simpint sigstack(const struct sigstack *, struct sigstack *); 12493032Simpint sigvec(int, struct sigvec *, struct sigvec *); 125104582Smike#endif 1261539Srgrimes__END_DECLS 1271539Srgrimes 1289343Sbde#endif /* !_SIGNAL_H_ */ 129