signal.h revision 281130
150477Speter/*- 2139749Simp * Copyright (c) 1991, 1993 3196008Smjacob * The Regents of the University of California. All rights reserved. 4167403Smjacob * 5167403Smjacob * Redistribution and use in source and binary forms, with or without 6167403Smjacob * modification, are permitted provided that the following conditions 7167403Smjacob * are met: 8167403Smjacob * 1. Redistributions of source code must retain the above copyright 9167403Smjacob * notice, this list of conditions and the following disclaimer. 10167403Smjacob * 2. Redistributions in binary form must reproduce the above copyright 11167403Smjacob * notice, this list of conditions and the following disclaimer in the 12167403Smjacob * documentation and/or other materials provided with the distribution. 13167403Smjacob * 3. Neither the name of the University nor the names of its contributors 14167403Smjacob * may be used to endorse or promote products derived from this software 15167403Smjacob * without specific prior written permission. 16167403Smjacob * 17167403Smjacob * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18167403Smjacob * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19167403Smjacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20167403Smjacob * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21167403Smjacob * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22167403Smjacob * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23167403Smjacob * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24167403Smjacob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25167403Smjacob * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26167403Smjacob * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27196008Smjacob * SUCH DAMAGE. 28167403Smjacob * 29167403Smjacob * @(#)signal.h 8.3 (Berkeley) 3/30/94 3035388Smjacob * $FreeBSD: head/include/signal.h 281130 2015-04-06 01:39:16Z pfg $ 3135388Smjacob */ 3235388Smjacob 3335388Smjacob#ifndef _SIGNAL_H_ 3435388Smjacob#define _SIGNAL_H_ 3535388Smjacob 3635388Smjacob#include <sys/cdefs.h> 3735388Smjacob#include <sys/_types.h> 3835388Smjacob#include <sys/signal.h> 3935388Smjacob 4035388Smjacob#if __BSD_VISIBLE 4135388Smjacob/* 4235388Smjacob * XXX should enlarge these, if only to give empty names instead of bounds 4335388Smjacob * errors for large signal numbers. 4435388Smjacob */ 4535388Smjacobextern const char * const sys_signame[NSIG]; 4635388Smjacobextern const char * const sys_siglist[NSIG]; 4735388Smjacobextern const int sys_nsig; 4835388Smjacob#endif 4935388Smjacob 5035388Smjacob#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE 5135388Smjacob#ifndef _PID_T_DECLARED 5235388Smjacobtypedef __pid_t pid_t; 5335388Smjacob#define _PID_T_DECLARED 5435388Smjacob#endif 5546967Smjacob#endif 5646967Smjacob 5746967Smjacob#if __POSIX_VISIBLE || __XSI_VISIBLE 5846967Smjacobstruct pthread; /* XXX */ 5946967Smjacobtypedef struct pthread *__pthread_t; 6046967Smjacob#if !defined(_PTHREAD_T_DECLARED) && __POSIX_VISIBLE >= 200809 6146967Smjacobtypedef __pthread_t pthread_t; 6246967Smjacob#define _PTHREAD_T_DECLARED 6335388Smjacob#endif 6435388Smjacob#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ 6544819Smjacob 6635388Smjacob__BEGIN_DECLS 6744819Smjacobint raise(int); 6844819Smjacob 6982689Smjacob#if __POSIX_VISIBLE || __XSI_VISIBLE 70163899Smjacobint kill(__pid_t, int); 7135388Smjacobint pthread_kill(__pthread_t, int); 7235388Smjacobint pthread_sigmask(int, const __sigset_t * __restrict, 7344819Smjacob __sigset_t * __restrict); 7435388Smjacobint sigaction(int, const struct sigaction * __restrict, 7535388Smjacob struct sigaction * __restrict); 7644819Smjacobint sigaddset(sigset_t *, int); 7735388Smjacobint sigdelset(sigset_t *, int); 7835388Smjacobint sigemptyset(sigset_t *); 7944819Smjacobint sigfillset(sigset_t *); 8044819Smjacobint sigismember(const sigset_t *, int); 8144819Smjacobint sigpending(sigset_t *) __nonnull(1); 8244819Smjacobint sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict); 8364088Smjacobint sigsuspend(const sigset_t *) __nonnull(1); 8464088Smjacobint sigwait(const sigset_t * __restrict, int * __restrict) __nonnull_all; 8564088Smjacob#endif 8635388Smjacob 8735388Smjacob#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600 8835388Smjacobint sigqueue(__pid_t, int, const union sigval); 8935388Smjacob 9035388Smjacobstruct timespec; 9144819Smjacobint sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict, 9244819Smjacob const struct timespec * __restrict); 9344819Smjacobint sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict); 9444819Smjacob#endif 9544819Smjacob 9644819Smjacob#if __XSI_VISIBLE 9744819Smjacobint killpg(__pid_t, int); 9844819Smjacobint sigaltstack(const stack_t * __restrict, stack_t * __restrict); 9935388Smjacobint sighold(int); 10035388Smjacobint sigignore(int); 10135388Smjacobint sigpause(int); 10235388Smjacobint sigrelse(int); 10344819Smjacobvoid (*sigset(int, void (*)(int)))(int); 10454671Smjacobint xsi_sigpause(int); 10554671Smjacob#endif 10654671Smjacob 10754671Smjacob#if __XSI_VISIBLE >= 600 10854671Smjacobint siginterrupt(int, int); 10954671Smjacob#endif 11054671Smjacob 11154671Smjacob#if __POSIX_VISIBLE >= 200809 11254671Smjacobvoid psignal(unsigned int, const char *); 11354671Smjacob#endif 11454671Smjacob 11582689Smjacob#if __BSD_VISIBLE 11682689Smjacobint sigblock(int); 11782689Smjacobstruct __ucontext; /* XXX spec requires a complete declaration. */ 11882689Smjacobint sigreturn(const struct __ucontext *); 11982689Smjacobint sigsetmask(int); 12082689Smjacobint sigstack(const struct sigstack *, struct sigstack *); 12182689Smjacobint sigvec(int, struct sigvec *, struct sigvec *); 12282689Smjacob#endif 12382689Smjacob__END_DECLS 12482689Smjacob 12582689Smjacob#endif /* !_SIGNAL_H_ */ 12682689Smjacob