xref: /freebsd/include/signal.h (revision 448f5f73dcc7efe69df16b6a875b0cf0c6f41ae3)
159deaec5SRodney W. Grimes /*-
259deaec5SRodney W. Grimes  * Copyright (c) 1991, 1993
359deaec5SRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
459deaec5SRodney W. Grimes  *
559deaec5SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
659deaec5SRodney W. Grimes  * modification, are permitted provided that the following conditions
759deaec5SRodney W. Grimes  * are met:
859deaec5SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
959deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
1059deaec5SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
1159deaec5SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
1259deaec5SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
13f2556687SWarner Losh  * 3. Neither the name of the University nor the names of its contributors
1459deaec5SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
1559deaec5SRodney W. Grimes  *    without specific prior written permission.
1659deaec5SRodney W. Grimes  *
1759deaec5SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
1859deaec5SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1959deaec5SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2059deaec5SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2159deaec5SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2259deaec5SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2359deaec5SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2459deaec5SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2559deaec5SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2659deaec5SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2759deaec5SRodney W. Grimes  * SUCH DAMAGE.
2859deaec5SRodney W. Grimes  *
2959deaec5SRodney W. Grimes  *	@(#)signal.h	8.3 (Berkeley) 3/30/94
303cf3c5d9SMarcel Moolenaar  * $FreeBSD$
3159deaec5SRodney W. Grimes  */
3259deaec5SRodney W. Grimes 
33943c1801SBruce Evans #ifndef _SIGNAL_H_
34943c1801SBruce Evans #define	_SIGNAL_H_
3559deaec5SRodney W. Grimes 
3659deaec5SRodney W. Grimes #include <sys/cdefs.h>
37abbd8902SMike Barcroft #include <sys/_types.h>
38c989e80eSDoug Rabson #include <sys/signal.h>
3959deaec5SRodney W. Grimes 
40eb74223bSMike Barcroft #if __BSD_VISIBLE
41ed583c28SMike Barcroft /*
42ed583c28SMike Barcroft  * XXX should enlarge these, if only to give empty names instead of bounds
43ed583c28SMike Barcroft  * errors for large signal numbers.
44ed583c28SMike Barcroft  */
45f6ab8089SEd Schouten extern const char * const sys_signame[NSIG];
46f6ab8089SEd Schouten extern const char * const sys_siglist[NSIG];
47f6ab8089SEd Schouten extern const int sys_nsig;
4859deaec5SRodney W. Grimes #endif
4959deaec5SRodney W. Grimes 
503357acddSMike Barcroft #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
51eb74223bSMike Barcroft #ifndef _PID_T_DECLARED
52eb74223bSMike Barcroft typedef	__pid_t		pid_t;
53eb74223bSMike Barcroft #define	_PID_T_DECLARED
54eb74223bSMike Barcroft #endif
55eb74223bSMike Barcroft #endif
56eb74223bSMike Barcroft 
5748a3f7d9SDavid Schultz #if __POSIX_VISIBLE || __XSI_VISIBLE
5848a3f7d9SDavid Schultz struct pthread;		/* XXX */
5948a3f7d9SDavid Schultz typedef struct pthread *__pthread_t;
6048a3f7d9SDavid Schultz #if !defined(_PTHREAD_T_DECLARED) && __POSIX_VISIBLE >= 200809
6148a3f7d9SDavid Schultz typedef __pthread_t pthread_t;
6248a3f7d9SDavid Schultz #define	_PTHREAD_T_DECLARED
6348a3f7d9SDavid Schultz #endif
6448a3f7d9SDavid Schultz #endif /* __POSIX_VISIBLE || __XSI_VISIBLE */
6548a3f7d9SDavid Schultz 
6659deaec5SRodney W. Grimes __BEGIN_DECLS
67bb28f3c2SWarner Losh int	raise(int);
68eb74223bSMike Barcroft 
693357acddSMike Barcroft #if __POSIX_VISIBLE || __XSI_VISIBLE
70abbd8902SMike Barcroft int	kill(__pid_t, int);
7148a3f7d9SDavid Schultz int	pthread_kill(__pthread_t, int);
72ba13377aSKonstantin Belousov int	pthread_sigmask(int, const __sigset_t * __restrict,
73ba13377aSKonstantin Belousov 	    __sigset_t * __restrict);
74e31d11c3SRobert Drehmel int	sigaction(int, const struct sigaction * __restrict,
75e31d11c3SRobert Drehmel 	    struct sigaction * __restrict);
76bb28f3c2SWarner Losh int	sigaddset(sigset_t *, int);
77bb28f3c2SWarner Losh int	sigdelset(sigset_t *, int);
78bb28f3c2SWarner Losh int	sigemptyset(sigset_t *);
79bb28f3c2SWarner Losh int	sigfillset(sigset_t *);
80bb28f3c2SWarner Losh int	sigismember(const sigset_t *, int);
81bb28f3c2SWarner Losh int	sigpending(sigset_t *);
82e31d11c3SRobert Drehmel int	sigprocmask(int, const sigset_t * __restrict, sigset_t * __restrict);
83bb28f3c2SWarner Losh int	sigsuspend(const sigset_t *);
8454e4e385SMike Barcroft int	sigwait(const sigset_t * __restrict, int * __restrict);
85eb74223bSMike Barcroft #endif
86aac4ad2cSPeter Dufault 
873357acddSMike Barcroft #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 600
88d2c8dd81SDavid Xu int	sigqueue(__pid_t, int, const union sigval);
8905e72facSDavid Xu 
90ed583c28SMike Barcroft struct timespec;
91e31d11c3SRobert Drehmel int	sigtimedwait(const sigset_t * __restrict, siginfo_t * __restrict,
92e31d11c3SRobert Drehmel 	    const struct timespec * __restrict);
93e31d11c3SRobert Drehmel int	sigwaitinfo(const sigset_t * __restrict, siginfo_t * __restrict);
94917e476dSPeter Dufault #endif
95eb74223bSMike Barcroft 
963357acddSMike Barcroft #if __XSI_VISIBLE
97abbd8902SMike Barcroft int	killpg(__pid_t, int);
98e31d11c3SRobert Drehmel int	sigaltstack(const stack_t * __restrict, stack_t * __restrict);
99536fb659SOlivier Houchard int	sighold(int);
100536fb659SOlivier Houchard int	sigignore(int);
101536fb659SOlivier Houchard int	sigpause(int);
102536fb659SOlivier Houchard int	sigrelse(int);
103536fb659SOlivier Houchard void	(*sigset(int, void (*)(int)))(int);
104536fb659SOlivier Houchard int	xsi_sigpause(int);
105eb74223bSMike Barcroft #endif
106eb74223bSMike Barcroft 
10748a3f7d9SDavid Schultz #if __XSI_VISIBLE >= 600
1083357acddSMike Barcroft int	siginterrupt(int, int);
1093357acddSMike Barcroft #endif
1103357acddSMike Barcroft 
111*448f5f73SJilles Tjoelker #if __POSIX_VISIBLE >= 200809
112a5e88ed7SDavid Schultz void	psignal(unsigned int, const char *);
113a5e88ed7SDavid Schultz #endif
114a5e88ed7SDavid Schultz 
115eb74223bSMike Barcroft #if __BSD_VISIBLE
116eb74223bSMike Barcroft int	sigblock(int);
117ed583c28SMike Barcroft struct __ucontext;		/* XXX spec requires a complete declaration. */
118bb28f3c2SWarner Losh int	sigreturn(const struct __ucontext *);
119bb28f3c2SWarner Losh int	sigsetmask(int);
120bb28f3c2SWarner Losh int	sigstack(const struct sigstack *, struct sigstack *);
121bb28f3c2SWarner Losh int	sigvec(int, struct sigvec *, struct sigvec *);
122eb74223bSMike Barcroft #endif
12359deaec5SRodney W. Grimes __END_DECLS
12459deaec5SRodney W. Grimes 
125943c1801SBruce Evans #endif /* !_SIGNAL_H_ */
126