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. 13203964Simp * 3. Neither the name of the University nor the names of its contributors 141539Srgrimes * may be used to endorse or promote products derived from this software 151539Srgrimes * without specific prior written permission. 161539Srgrimes * 171539Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 181539Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 191539Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 201539Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 211539Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 221539Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 231539Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 241539Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 251539Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 261539Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 271539Srgrimes * SUCH DAMAGE. 281539Srgrimes * 291539Srgrimes * @(#)signal.h 8.3 (Berkeley) 3/30/94 3051794Smarcel * $FreeBSD$ 311539Srgrimes */ 321539Srgrimes 339343Sbde#ifndef _SIGNAL_H_ 349343Sbde#define _SIGNAL_H_ 351539Srgrimes 361539Srgrimes#include <sys/cdefs.h> 37102227Smike#include <sys/_types.h> 381539Srgrimes#include <sys/signal.h> 391539Srgrimes 40104582Smike#if __BSD_VISIBLE 41105107Smike/* 42105107Smike * XXX should enlarge these, if only to give empty names instead of bounds 43105107Smike * errors for large signal numbers. 44105107Smike */ 45228468Sedextern const char * const sys_signame[NSIG]; 46228468Sedextern const char * const sys_siglist[NSIG]; 47228468Sedextern const int sys_nsig; 481539Srgrimes#endif 491539Srgrimes 50105013Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 51104582Smike#ifndef _PID_T_DECLARED 52104582Smiketypedef __pid_t pid_t; 53104582Smike#define _PID_T_DECLARED 54104582Smike#endif 55104582Smike#endif 56104582Smike 57189828Sdas#if __POSIX_VISIBLE || __XSI_VISIBLE 58189828Sdasstruct pthread; /* XXX */ 59189828Sdastypedef struct pthread *__pthread_t; 60189828Sdas#if !defined(_PTHREAD_T_DECLARED) && __POSIX_VISIBLE >= 200809 61189828Sdastypedef __pthread_t pthread_t; 62189828Sdas#define _PTHREAD_T_DECLARED 63189828Sdas#endif 64189828Sdas#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ 65189828Sdas 661539Srgrimes__BEGIN_DECLS 6793032Simpint raise(int); 68104582Smike 69105013Smike#if __POSIX_VISIBLE || __XSI_VISIBLE 70102227Smikeint kill(__pid_t, int); 71189828Sdasint pthread_kill(__pthread_t, int); 72218881Skibint pthread_sigmask(int, const __sigset_t * __restrict, 73218881Skib __sigset_t * __restrict); 74104368Srobertint sigaction(int, const struct sigaction * __restrict, 75104368Srobert struct sigaction * __restrict); 7693032Simpint sigaddset(sigset_t *, int); 7793032Simpint sigdelset(sigset_t *, int); 7893032Simpint sigemptyset(sigset_t *); 7993032Simpint sigfillset(sigset_t *); 8093032Simpint sigismember(const sigset_t *, int); 8193032Simpint sigpending(sigset_t *); 82104368Srobertint sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); 8393032Simpint sigsuspend(const sigset_t *); 84104989Smikeint sigwait(const sigset_t * __restrict, int * __restrict); 85104582Smike#endif 8634319Sdufault 87105013Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 88151395Sdavidxuint sigqueue(__pid_t, int, const union sigval); 89151318Sdavidxu 90105107Smikestruct timespec; 91104582Smikeint sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict, 92104368Srobert const struct timespec * __restrict); 93104582Smikeint sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict); 94104582Smike#endif 9534319Sdufault 96105013Smike#if __XSI_VISIBLE 97102227Smikeint killpg(__pid_t, int); 98104368Srobertint sigaltstack(const stack_t * __restrict, stack_t * __restrict); 99200881Scognetint sighold(int); 100200881Scognetint sigignore(int); 101200881Scognetint sigpause(int); 102200881Scognetint sigrelse(int); 103200881Scognetvoid (*sigset(int, void (*)(int)))(int); 104200881Scognetint xsi_sigpause(int); 105104582Smike#endif 106104582Smike 107189828Sdas#if __XSI_VISIBLE >= 600 108105013Smikeint siginterrupt(int, int); 109105013Smike#endif 110105013Smike 111189352Sdas#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE 112189352Sdasvoid psignal(unsigned int, const char *); 113189352Sdas#endif 114189352Sdas 115104582Smike#if __BSD_VISIBLE 116104582Smikeint sigblock(int); 117105107Smikestruct __ucontext; /* XXX spec requires a complete declaration. */ 11893032Simpint sigreturn(const struct __ucontext *); 11993032Simpint sigsetmask(int); 12093032Simpint sigstack(const struct sigstack *, struct sigstack *); 12193032Simpint sigvec(int, struct sigvec *, struct sigvec *); 122104582Smike#endif 1231539Srgrimes__END_DECLS 1241539Srgrimes 1259343Sbde#endif /* !_SIGNAL_H_ */ 126