xref: /illumos-gate/usr/src/uts/common/sys/signal.h (revision 5e989a96186a37eb528fb7bb4d28a150874ec799)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5f841f6adSraf  * Common Development and Distribution License (the "License").
6f841f6adSraf  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21f841f6adSraf 
227c478bd9Sstevel@tonic-gate /*
23bdf0047cSRoger A. Faulkner  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
287c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate /*
317c478bd9Sstevel@tonic-gate  * University Copyright- Copyright (c) 1982, 1986, 1988
327c478bd9Sstevel@tonic-gate  * The Regents of the University of California
337c478bd9Sstevel@tonic-gate  * All Rights Reserved
347c478bd9Sstevel@tonic-gate  *
357c478bd9Sstevel@tonic-gate  * University Acknowledgment- Portions of this document are derived from
367c478bd9Sstevel@tonic-gate  * software developed by the University of California, Berkeley, and its
377c478bd9Sstevel@tonic-gate  * contributors.
387c478bd9Sstevel@tonic-gate  */
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #ifndef _SYS_SIGNAL_H
417c478bd9Sstevel@tonic-gate #define	_SYS_SIGNAL_H
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
447c478bd9Sstevel@tonic-gate #include <sys/iso/signal_iso.h>
457c478bd9Sstevel@tonic-gate 
467c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
477c478bd9Sstevel@tonic-gate extern "C" {
487c478bd9Sstevel@tonic-gate #endif
497c478bd9Sstevel@tonic-gate 
507c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || !defined(_STRICT_STDC) || \
517c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
547c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
557c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
567c478bd9Sstevel@tonic-gate /*
577c478bd9Sstevel@tonic-gate  * We need <sys/siginfo.h> for the declaration of siginfo_t.
587c478bd9Sstevel@tonic-gate  */
597c478bd9Sstevel@tonic-gate #include <sys/siginfo.h>
607c478bd9Sstevel@tonic-gate #endif
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate /* Duplicated in <sys/ucontext.h> as a result of XPG4v2 requirements */
637c478bd9Sstevel@tonic-gate #ifndef	_SIGSET_T
647c478bd9Sstevel@tonic-gate #define	_SIGSET_T
657c478bd9Sstevel@tonic-gate typedef struct {		/* signal set type */
667c478bd9Sstevel@tonic-gate 	unsigned int	__sigbits[4];
677c478bd9Sstevel@tonic-gate } sigset_t;
687c478bd9Sstevel@tonic-gate #endif	/* _SIGSET_T */
697c478bd9Sstevel@tonic-gate 
707c478bd9Sstevel@tonic-gate typedef	struct {
71bdf0047cSRoger A. Faulkner 	unsigned int	__sigbits[3];
727c478bd9Sstevel@tonic-gate } k_sigset_t;
737c478bd9Sstevel@tonic-gate 
747c478bd9Sstevel@tonic-gate /*
757c478bd9Sstevel@tonic-gate  * The signal handler routine can have either one or three arguments.
767c478bd9Sstevel@tonic-gate  * Existing C code has used either form so not specifing the arguments
777c478bd9Sstevel@tonic-gate  * neatly finesses the problem.  C++ doesn't accept this.  To C++
787c478bd9Sstevel@tonic-gate  * "(*sa_handler)()" indicates a routine with no arguments (ANSI C would
797c478bd9Sstevel@tonic-gate  * specify this as "(*sa_handler)(void)").  One or the other form must be
807c478bd9Sstevel@tonic-gate  * used for C++ and the only logical choice is "(*sa_handler)(int)" to allow
817c478bd9Sstevel@tonic-gate  * the SIG_* defines to work.  "(*sa_sigaction)(int, siginfo_t *, void *)"
827c478bd9Sstevel@tonic-gate  * can be used for the three argument form.
837c478bd9Sstevel@tonic-gate  */
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /*
867c478bd9Sstevel@tonic-gate  * Note: storage overlap by sa_handler and sa_sigaction
877c478bd9Sstevel@tonic-gate  */
887c478bd9Sstevel@tonic-gate struct sigaction {
897c478bd9Sstevel@tonic-gate 	int sa_flags;
907c478bd9Sstevel@tonic-gate 	union {
917c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
927c478bd9Sstevel@tonic-gate 		void (*_handler)(int);
937c478bd9Sstevel@tonic-gate #else
947c478bd9Sstevel@tonic-gate 		void (*_handler)();
957c478bd9Sstevel@tonic-gate #endif
967c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
977c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
987c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
997c478bd9Sstevel@tonic-gate 		void (*_sigaction)(int, siginfo_t *, void *);
1007c478bd9Sstevel@tonic-gate #endif
1017c478bd9Sstevel@tonic-gate 	}	_funcptr;
1027c478bd9Sstevel@tonic-gate 	sigset_t sa_mask;
1037c478bd9Sstevel@tonic-gate #ifndef _LP64
1047c478bd9Sstevel@tonic-gate 	int sa_resv[2];
1057c478bd9Sstevel@tonic-gate #endif
1067c478bd9Sstevel@tonic-gate };
1077c478bd9Sstevel@tonic-gate #define	sa_handler	_funcptr._handler
1087c478bd9Sstevel@tonic-gate #define	sa_sigaction	_funcptr._sigaction
1097c478bd9Sstevel@tonic-gate 
1107c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1117c478bd9Sstevel@tonic-gate 
1127c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user sigaction structure */
1137c478bd9Sstevel@tonic-gate 
1147c478bd9Sstevel@tonic-gate struct sigaction32 {
1157c478bd9Sstevel@tonic-gate 	int32_t		sa_flags;
1167c478bd9Sstevel@tonic-gate 	union {
1177c478bd9Sstevel@tonic-gate 		caddr32_t	_handler;
1187c478bd9Sstevel@tonic-gate 		caddr32_t	_sigaction;
1197c478bd9Sstevel@tonic-gate 	}	_funcptr;
120bdf0047cSRoger A. Faulkner 	sigset_t	sa_mask;
1217c478bd9Sstevel@tonic-gate 	int32_t		sa_resv[2];
1227c478bd9Sstevel@tonic-gate };
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /* this is only valid for SIGCLD */
1277c478bd9Sstevel@tonic-gate #define	SA_NOCLDSTOP	0x00020000	/* don't send job control SIGCLD's */
1287c478bd9Sstevel@tonic-gate #endif
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1317c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1327c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate 			/* non-conformant ANSI compilation	*/
1357c478bd9Sstevel@tonic-gate 
1367c478bd9Sstevel@tonic-gate /* definitions for the sa_flags field */
1377c478bd9Sstevel@tonic-gate #define	SA_ONSTACK	0x00000001
1387c478bd9Sstevel@tonic-gate #define	SA_RESETHAND	0x00000002
1397c478bd9Sstevel@tonic-gate #define	SA_RESTART	0x00000004
1407c478bd9Sstevel@tonic-gate #endif
1417c478bd9Sstevel@tonic-gate 
1427c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1437c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1447c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
1457c478bd9Sstevel@tonic-gate #define	SA_SIGINFO	0x00000008
1467c478bd9Sstevel@tonic-gate #endif
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1497c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1507c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
1517c478bd9Sstevel@tonic-gate #define	SA_NODEFER	0x00000010
1527c478bd9Sstevel@tonic-gate 
1537c478bd9Sstevel@tonic-gate /* this is only valid for SIGCLD */
1547c478bd9Sstevel@tonic-gate #define	SA_NOCLDWAIT	0x00010000	/* don't save zombie children	 */
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_XPG4_2)
1577c478bd9Sstevel@tonic-gate /*
1587c478bd9Sstevel@tonic-gate  * use of these symbols by applications is injurious
1597c478bd9Sstevel@tonic-gate  *	to binary compatibility
1607c478bd9Sstevel@tonic-gate  */
161bdf0047cSRoger A. Faulkner #define	NSIG	73	/* valid signals range from 1 to NSIG-1 */
162bdf0047cSRoger A. Faulkner #define	MAXSIG	72	/* size of u_signal[], NSIG-1 <= MAXSIG */
1637c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_XPG4_2) */
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate #define	MINSIGSTKSZ	2048
1667c478bd9Sstevel@tonic-gate #define	SIGSTKSZ	8192
1677c478bd9Sstevel@tonic-gate 
1687c478bd9Sstevel@tonic-gate #define	SS_ONSTACK	0x00000001
1697c478bd9Sstevel@tonic-gate #define	SS_DISABLE	0x00000002
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate /* Duplicated in <sys/ucontext.h> as a result of XPG4v2 requirements. */
1727c478bd9Sstevel@tonic-gate #ifndef	_STACK_T
1737c478bd9Sstevel@tonic-gate #define	_STACK_T
1747c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_XPG4_2)
1757c478bd9Sstevel@tonic-gate typedef struct sigaltstack {
1767c478bd9Sstevel@tonic-gate #else
1777c478bd9Sstevel@tonic-gate typedef struct {
1787c478bd9Sstevel@tonic-gate #endif
1797c478bd9Sstevel@tonic-gate 	void	*ss_sp;
1807c478bd9Sstevel@tonic-gate 	size_t	ss_size;
1817c478bd9Sstevel@tonic-gate 	int	ss_flags;
1827c478bd9Sstevel@tonic-gate } stack_t;
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user sigaltstack structure */
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate typedef struct sigaltstack32 {
1897c478bd9Sstevel@tonic-gate 	caddr32_t	ss_sp;
1907c478bd9Sstevel@tonic-gate 	size32_t	ss_size;
1917c478bd9Sstevel@tonic-gate 	int32_t		ss_flags;
1927c478bd9Sstevel@tonic-gate } stack32_t;
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
1957c478bd9Sstevel@tonic-gate 
1967c478bd9Sstevel@tonic-gate #endif /* _STACK_T */
1977c478bd9Sstevel@tonic-gate 
1987c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
2017c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
2027c478bd9Sstevel@tonic-gate 
203f841f6adSraf /* signotify id used only by libc for mq_notify()/aio_notify() */
2047c478bd9Sstevel@tonic-gate typedef struct signotify_id {		/* signotify id struct		*/
2057c478bd9Sstevel@tonic-gate 	pid_t	sn_pid;			/* pid of proc to be notified	*/
2067c478bd9Sstevel@tonic-gate 	int	sn_index;		/* index in preallocated pool	*/
2077c478bd9Sstevel@tonic-gate 	int	sn_pad;			/* reserved			*/
2087c478bd9Sstevel@tonic-gate } signotify_id_t;
2097c478bd9Sstevel@tonic-gate 
2107c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2117c478bd9Sstevel@tonic-gate 
2127c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user signotify_id structure */
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate typedef struct signotify32_id {
2157c478bd9Sstevel@tonic-gate 	pid32_t	sn_pid;			/* pid of proc to be notified */
2167c478bd9Sstevel@tonic-gate 	int32_t	sn_index;		/* index in preallocated pool */
2177c478bd9Sstevel@tonic-gate 	int32_t	sn_pad;			/* reserved */
2187c478bd9Sstevel@tonic-gate } signotify32_id_t;
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate /* Command codes for sig_notify call */
2237c478bd9Sstevel@tonic-gate 
2247c478bd9Sstevel@tonic-gate #define	SN_PROC		1		/* queue signotify for process	*/
2257c478bd9Sstevel@tonic-gate #define	SN_CANCEL	2		/* cancel the queued signotify	*/
2267c478bd9Sstevel@tonic-gate #define	SN_SEND		3		/* send the notified signal	*/
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
2297c478bd9Sstevel@tonic-gate 
2307c478bd9Sstevel@tonic-gate /* Added as per XPG4v2 */
2317c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
2327c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2337c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
2347c478bd9Sstevel@tonic-gate struct sigstack {
2357c478bd9Sstevel@tonic-gate 	void	*ss_sp;
2367c478bd9Sstevel@tonic-gate 	int	ss_onstack;
2377c478bd9Sstevel@tonic-gate };
2387c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
2397c478bd9Sstevel@tonic-gate 
2407c478bd9Sstevel@tonic-gate /*
2417c478bd9Sstevel@tonic-gate  * For definition of ucontext_t; must follow struct definition
2427c478bd9Sstevel@tonic-gate  * for  sigset_t
2437c478bd9Sstevel@tonic-gate  */
2447c478bd9Sstevel@tonic-gate #if defined(_XPG4_2)
2457c478bd9Sstevel@tonic-gate #include <sys/ucontext.h>
2467c478bd9Sstevel@tonic-gate #endif /* defined(_XPG4_2) */
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate #ifdef _KERNEL
2497c478bd9Sstevel@tonic-gate #include <sys/t_lock.h>
2507c478bd9Sstevel@tonic-gate 
251bdf0047cSRoger A. Faulkner extern const k_sigset_t nullsmask;	/* a null signal mask */
252bdf0047cSRoger A. Faulkner extern const k_sigset_t fillset;	/* all signals, guaranteed contiguous */
253bdf0047cSRoger A. Faulkner extern const k_sigset_t cantmask;	/* cannot be caught or ignored */
254bdf0047cSRoger A. Faulkner extern const k_sigset_t cantreset;	/* cannot be reset after catching */
255bdf0047cSRoger A. Faulkner extern const k_sigset_t ignoredefault;	/* ignored by default */
256bdf0047cSRoger A. Faulkner extern const k_sigset_t stopdefault;	/* stop by default */
257bdf0047cSRoger A. Faulkner extern const k_sigset_t coredefault;	/* dumps core by default */
258bdf0047cSRoger A. Faulkner extern const k_sigset_t holdvfork;	/* held while doing vfork */
2597c478bd9Sstevel@tonic-gate 
2607c478bd9Sstevel@tonic-gate #define	sigmask(n)		((unsigned int)1 << (((n) - 1) & (32 - 1)))
2617c478bd9Sstevel@tonic-gate #define	sigword(n)		(((unsigned int)((n) - 1))>>5)
2627c478bd9Sstevel@tonic-gate 
263bdf0047cSRoger A. Faulkner #if ((MAXSIG > (2 * 32)) && (MAXSIG <= (3 * 32)))
2647c478bd9Sstevel@tonic-gate #define	FILLSET0	0xffffffffu
265bdf0047cSRoger A. Faulkner #define	FILLSET1	0xffffffffu
266bdf0047cSRoger A. Faulkner #define	FILLSET2	((1u << (MAXSIG - 64)) - 1)
2677c478bd9Sstevel@tonic-gate #else
2687c478bd9Sstevel@tonic-gate #error "fix me: MAXSIG out of bounds"
2697c478bd9Sstevel@tonic-gate #endif
2707c478bd9Sstevel@tonic-gate 
2717c478bd9Sstevel@tonic-gate #define	CANTMASK0	(sigmask(SIGKILL)|sigmask(SIGSTOP))
2727c478bd9Sstevel@tonic-gate #define	CANTMASK1	0
273bdf0047cSRoger A. Faulkner #define	CANTMASK2	0
2747c478bd9Sstevel@tonic-gate 
2757c478bd9Sstevel@tonic-gate #define	sigemptyset(s)		(*(s) = nullsmask)
2767c478bd9Sstevel@tonic-gate #define	sigfillset(s)		(*(s) = fillset)
2777c478bd9Sstevel@tonic-gate #define	sigaddset(s, n)		((s)->__sigbits[sigword(n)] |= sigmask(n))
2787c478bd9Sstevel@tonic-gate #define	sigdelset(s, n)		((s)->__sigbits[sigword(n)] &= ~sigmask(n))
2797c478bd9Sstevel@tonic-gate #define	sigismember(s, n)	(sigmask(n) & (s)->__sigbits[sigword(n)])
280bdf0047cSRoger A. Faulkner #define	sigisempty(s)		(!((s)->__sigbits[0] | (s)->__sigbits[1] | \
281bdf0047cSRoger A. Faulkner 				(s)->__sigbits[2]))
2827c478bd9Sstevel@tonic-gate #define	sigutok(us, ks)		\
2837c478bd9Sstevel@tonic-gate 	((ks)->__sigbits[0] = (us)->__sigbits[0] & (FILLSET0 & ~CANTMASK0), \
284bdf0047cSRoger A. Faulkner 	(ks)->__sigbits[1] = (us)->__sigbits[1] & (FILLSET1 & ~CANTMASK1), \
285bdf0047cSRoger A. Faulkner 	(ks)->__sigbits[2] = (us)->__sigbits[2] & (FILLSET2 & ~CANTMASK2))
2867c478bd9Sstevel@tonic-gate #define	sigktou(ks, us)		((us)->__sigbits[0] = (ks)->__sigbits[0], \
287bdf0047cSRoger A. Faulkner 				(us)->__sigbits[1] = (ks)->__sigbits[1], \
288bdf0047cSRoger A. Faulkner 				(us)->__sigbits[2] = (ks)->__sigbits[2], \
289bdf0047cSRoger A. Faulkner 				(us)->__sigbits[3] = 0)
2907c478bd9Sstevel@tonic-gate typedef struct {
2917c478bd9Sstevel@tonic-gate 	int	sig;				/* signal no.		*/
2927c478bd9Sstevel@tonic-gate 	int	perm;				/* flag for EPERM	*/
2937c478bd9Sstevel@tonic-gate 	int	checkperm;			/* check perm or not	*/
2947c478bd9Sstevel@tonic-gate 	int	sicode;				/* has siginfo.si_code	*/
2957c478bd9Sstevel@tonic-gate 	union sigval value;			/* user specified value	*/
2967c478bd9Sstevel@tonic-gate } sigsend_t;
2977c478bd9Sstevel@tonic-gate 
2987c478bd9Sstevel@tonic-gate typedef struct {
2997c478bd9Sstevel@tonic-gate 	sigqueue_t	sn_sigq;	/* sigq struct for notification */
3007c478bd9Sstevel@tonic-gate 	u_longlong_t	sn_snid;	/* unique id for notification	*/
3017c478bd9Sstevel@tonic-gate } signotifyq_t;
3027c478bd9Sstevel@tonic-gate 
3037c478bd9Sstevel@tonic-gate typedef struct sigqhdr {		/* sigqueue pool header		*/
3047c478bd9Sstevel@tonic-gate 	sigqueue_t	*sqb_free;	/* free sigq struct list	*/
305*5e989a96SDavid Höppner 	int		sqb_count;	/* sigq free count		*/
306*5e989a96SDavid Höppner 	uint_t		sqb_maxcount;	/* sigq max free count		*/
307*5e989a96SDavid Höppner 	size_t		sqb_size;	/* size of header+free structs	*/
3087c478bd9Sstevel@tonic-gate 	uchar_t		sqb_pexited;	/* process has exited		*/
309*5e989a96SDavid Höppner 	uint_t		sqb_sent;	/* number of sigq sent		*/
310f841f6adSraf 	kcondvar_t	sqb_cv;		/* waiting for a sigq struct	*/
3117c478bd9Sstevel@tonic-gate 	kmutex_t	sqb_lock;	/* lock for sigq pool		*/
3127c478bd9Sstevel@tonic-gate } sigqhdr_t;
3137c478bd9Sstevel@tonic-gate 
314*5e989a96SDavid Höppner #define	_SIGQUEUE_SIZE_BASIC		128	/* basic limit */
315*5e989a96SDavid Höppner #define	_SIGQUEUE_SIZE_PRIVILEGED	512	/* privileged limit */
316*5e989a96SDavid Höppner 
3177c478bd9Sstevel@tonic-gate #define	_SIGNOTIFY_MAX	32
3187c478bd9Sstevel@tonic-gate 
319bdf0047cSRoger A. Faulkner extern	void	setsigact(int, void (*)(int), const k_sigset_t *, int);
320bdf0047cSRoger A. Faulkner extern	void	sigorset(k_sigset_t *, const k_sigset_t *);
321bdf0047cSRoger A. Faulkner extern	void	sigandset(k_sigset_t *, const k_sigset_t *);
322bdf0047cSRoger A. Faulkner extern	void	sigdiffset(k_sigset_t *, const k_sigset_t *);
3237c478bd9Sstevel@tonic-gate extern	void	sigintr(k_sigset_t *, int);
3247c478bd9Sstevel@tonic-gate extern	void	sigunintr(k_sigset_t *);
3257c478bd9Sstevel@tonic-gate extern	void	sigreplace(k_sigset_t *, k_sigset_t *);
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate extern	int	kill(pid_t, int);
3287c478bd9Sstevel@tonic-gate 
3297c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
3307c478bd9Sstevel@tonic-gate 
3317c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3327c478bd9Sstevel@tonic-gate }
3337c478bd9Sstevel@tonic-gate #endif
3347c478bd9Sstevel@tonic-gate 
3357c478bd9Sstevel@tonic-gate #endif /* _SYS_SIGNAL_H */
336