signal.h revision 105107
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 *
3551794Smarcel * $FreeBSD: head/include/signal.h 105107 2002-10-14 14:13:37Z mike $
361539Srgrimes */
371539Srgrimes
389343Sbde#ifndef _SIGNAL_H_
399343Sbde#define	_SIGNAL_H_
401539Srgrimes
411539Srgrimes#include <sys/cdefs.h>
42102227Smike#include <sys/_types.h>
431539Srgrimes#include <sys/signal.h>
441539Srgrimes
45104582Smike#if __BSD_VISIBLE
46105107Smike/*
47105107Smike * XXX should enlarge these, if only to give empty names instead of bounds
48105107Smike * errors for large signal numbers.
49105107Smike */
501539Srgrimesextern __const char *__const sys_signame[NSIG];
511539Srgrimesextern __const char *__const sys_siglist[NSIG];
5247289Speterextern __const int sys_nsig;
531539Srgrimes#endif
541539Srgrimes
55105013Smike#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
56104582Smike#ifndef _PID_T_DECLARED
57104582Smiketypedef	__pid_t		pid_t;
58104582Smike#define	_PID_T_DECLARED
59104582Smike#endif
60104582Smike#endif
61104582Smike
621539Srgrimes__BEGIN_DECLS
6393032Simpint	raise(int);
64104582Smike
65105013Smike#if __POSIX_VISIBLE || __XSI_VISIBLE
66102227Smikeint	kill(__pid_t, int);
67104368Srobertint	sigaction(int, const struct sigaction * __restrict,
68104368Srobert	    struct sigaction * __restrict);
6993032Simpint	sigaddset(sigset_t *, int);
7093032Simpint	sigdelset(sigset_t *, int);
7193032Simpint	sigemptyset(sigset_t *);
7293032Simpint	sigfillset(sigset_t *);
7393032Simpint	sigismember(const sigset_t *, int);
7493032Simpint	sigpending(sigset_t *);
75104368Srobertint	sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
7693032Simpint	sigsuspend(const sigset_t *);
77104989Smikeint	sigwait(const sigset_t * __restrict, int * __restrict);
78104582Smike#endif
7934319Sdufault
80105013Smike#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600
81105107Smike#if 0
82105107Smike/*
83105107Smike * PR: 35924
84105107Smike * XXX we don't actually have these.  We set _POSIX_REALTIME_SIGNALS to
85105107Smike * -1 to show that we don't have them, but this symbol is not necessarily
86105107Smike * in scope (in the current implementation), so we can't use it here.
87105107Smike */
88104582Smikeint	sigqueue(__pid_t, int, const union sigval);
89105107Smikestruct timespec;
90104582Smikeint	sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict,
91104368Srobert	    const struct timespec * __restrict);
92104582Smikeint	sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict);
93104582Smike#endif
94105107Smike#endif
9534319Sdufault
96105013Smike#if __XSI_VISIBLE
97102227Smikeint	killpg(__pid_t, int);
98104368Srobertint	sigaltstack(const stack_t * __restrict, stack_t * __restrict);
9993032Simpint	sigpause(int);
100104582Smike#endif
101104582Smike
102105013Smike#if __POSIX_VISIBLE >= 200112
103105013Smikeint	siginterrupt(int, int);
104105013Smike#endif
105105013Smike
106104582Smike#if __BSD_VISIBLE
107104582Smikeint	sigblock(int);
108105107Smikestruct __ucontext;		/* XXX spec requires a complete declaration. */
10993032Simpint	sigreturn(const struct __ucontext *);
11093032Simpint	sigsetmask(int);
11193032Simpint	sigstack(const struct sigstack *, struct sigstack *);
11293032Simpint	sigvec(int, struct sigvec *, struct sigvec *);
11393032Simpvoid	psignal(unsigned int, const char *);
114104582Smike#endif
1151539Srgrimes__END_DECLS
1161539Srgrimes
1179343Sbde#endif /* !_SIGNAL_H_ */
118