xref: /titanic_44/usr/src/uts/common/sys/signal.h (revision f841f6ad96ea6675d6c6b35c749eaac601799fdf)
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
5*f841f6adSraf  * Common Development and Distribution License (the "License").
6*f841f6adSraf  * 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  */
21*f841f6adSraf 
227c478bd9Sstevel@tonic-gate /*
23*f841f6adSraf  * Copyright 2006 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
447c478bd9Sstevel@tonic-gate 
457c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
467c478bd9Sstevel@tonic-gate #include <sys/iso/signal_iso.h>
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
497c478bd9Sstevel@tonic-gate extern "C" {
507c478bd9Sstevel@tonic-gate #endif
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || !defined(_STRICT_STDC) || \
537c478bd9Sstevel@tonic-gate 	defined(__XOPEN_OR_POSIX)
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
567c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
577c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
587c478bd9Sstevel@tonic-gate /*
597c478bd9Sstevel@tonic-gate  * We need <sys/siginfo.h> for the declaration of siginfo_t.
607c478bd9Sstevel@tonic-gate  */
617c478bd9Sstevel@tonic-gate #include <sys/siginfo.h>
627c478bd9Sstevel@tonic-gate #endif
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate /* Duplicated in <sys/ucontext.h> as a result of XPG4v2 requirements */
657c478bd9Sstevel@tonic-gate #ifndef	_SIGSET_T
667c478bd9Sstevel@tonic-gate #define	_SIGSET_T
677c478bd9Sstevel@tonic-gate typedef struct {		/* signal set type */
687c478bd9Sstevel@tonic-gate 	unsigned int	__sigbits[4];
697c478bd9Sstevel@tonic-gate } sigset_t;
707c478bd9Sstevel@tonic-gate 
717c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user sigset_t structure */
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate typedef struct {
767c478bd9Sstevel@tonic-gate 	uint32_t	__sigbits[4];
777c478bd9Sstevel@tonic-gate } sigset32_t;
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
807c478bd9Sstevel@tonic-gate 
817c478bd9Sstevel@tonic-gate #endif	/* _SIGSET_T */
827c478bd9Sstevel@tonic-gate 
837c478bd9Sstevel@tonic-gate typedef	struct {
847c478bd9Sstevel@tonic-gate 	unsigned int	__sigbits[2];
857c478bd9Sstevel@tonic-gate } k_sigset_t;
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate /*
887c478bd9Sstevel@tonic-gate  * The signal handler routine can have either one or three arguments.
897c478bd9Sstevel@tonic-gate  * Existing C code has used either form so not specifing the arguments
907c478bd9Sstevel@tonic-gate  * neatly finesses the problem.  C++ doesn't accept this.  To C++
917c478bd9Sstevel@tonic-gate  * "(*sa_handler)()" indicates a routine with no arguments (ANSI C would
927c478bd9Sstevel@tonic-gate  * specify this as "(*sa_handler)(void)").  One or the other form must be
937c478bd9Sstevel@tonic-gate  * used for C++ and the only logical choice is "(*sa_handler)(int)" to allow
947c478bd9Sstevel@tonic-gate  * the SIG_* defines to work.  "(*sa_sigaction)(int, siginfo_t *, void *)"
957c478bd9Sstevel@tonic-gate  * can be used for the three argument form.
967c478bd9Sstevel@tonic-gate  */
977c478bd9Sstevel@tonic-gate 
987c478bd9Sstevel@tonic-gate /*
997c478bd9Sstevel@tonic-gate  * Note: storage overlap by sa_handler and sa_sigaction
1007c478bd9Sstevel@tonic-gate  */
1017c478bd9Sstevel@tonic-gate struct sigaction {
1027c478bd9Sstevel@tonic-gate 	int sa_flags;
1037c478bd9Sstevel@tonic-gate 	union {
1047c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1057c478bd9Sstevel@tonic-gate 		void (*_handler)(int);
1067c478bd9Sstevel@tonic-gate #else
1077c478bd9Sstevel@tonic-gate 		void (*_handler)();
1087c478bd9Sstevel@tonic-gate #endif
1097c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1107c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1117c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
1127c478bd9Sstevel@tonic-gate 		void (*_sigaction)(int, siginfo_t *, void *);
1137c478bd9Sstevel@tonic-gate #endif
1147c478bd9Sstevel@tonic-gate 	}	_funcptr;
1157c478bd9Sstevel@tonic-gate 	sigset_t sa_mask;
1167c478bd9Sstevel@tonic-gate #ifndef _LP64
1177c478bd9Sstevel@tonic-gate 	int sa_resv[2];
1187c478bd9Sstevel@tonic-gate #endif
1197c478bd9Sstevel@tonic-gate };
1207c478bd9Sstevel@tonic-gate #define	sa_handler	_funcptr._handler
1217c478bd9Sstevel@tonic-gate #define	sa_sigaction	_funcptr._sigaction
1227c478bd9Sstevel@tonic-gate 
1237c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1247c478bd9Sstevel@tonic-gate 
1257c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user sigaction structure */
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate struct sigaction32 {
1287c478bd9Sstevel@tonic-gate 	int32_t		sa_flags;
1297c478bd9Sstevel@tonic-gate 	union {
1307c478bd9Sstevel@tonic-gate 		caddr32_t	_handler;
1317c478bd9Sstevel@tonic-gate 		caddr32_t	_sigaction;
1327c478bd9Sstevel@tonic-gate 	}	_funcptr;
1337c478bd9Sstevel@tonic-gate 	sigset32_t	sa_mask;
1347c478bd9Sstevel@tonic-gate 	int32_t		sa_resv[2];
1357c478bd9Sstevel@tonic-gate };
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1387c478bd9Sstevel@tonic-gate 
1397c478bd9Sstevel@tonic-gate /* this is only valid for SIGCLD */
1407c478bd9Sstevel@tonic-gate #define	SA_NOCLDSTOP	0x00020000	/* don't send job control SIGCLD's */
1417c478bd9Sstevel@tonic-gate #endif
1427c478bd9Sstevel@tonic-gate 
1437c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1447c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1457c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
1467c478bd9Sstevel@tonic-gate 
1477c478bd9Sstevel@tonic-gate 			/* non-conformant ANSI compilation	*/
1487c478bd9Sstevel@tonic-gate 
1497c478bd9Sstevel@tonic-gate /* definitions for the sa_flags field */
1507c478bd9Sstevel@tonic-gate #define	SA_ONSTACK	0x00000001
1517c478bd9Sstevel@tonic-gate #define	SA_RESETHAND	0x00000002
1527c478bd9Sstevel@tonic-gate #define	SA_RESTART	0x00000004
1537c478bd9Sstevel@tonic-gate #endif
1547c478bd9Sstevel@tonic-gate 
1557c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1567c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(_POSIX_C_SOURCE)) || \
1577c478bd9Sstevel@tonic-gate 	(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
1587c478bd9Sstevel@tonic-gate #define	SA_SIGINFO	0x00000008
1597c478bd9Sstevel@tonic-gate #endif
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
1627c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
1637c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
1647c478bd9Sstevel@tonic-gate #define	SA_NODEFER	0x00000010
1657c478bd9Sstevel@tonic-gate 
1667c478bd9Sstevel@tonic-gate /* this is only valid for SIGCLD */
1677c478bd9Sstevel@tonic-gate #define	SA_NOCLDWAIT	0x00010000	/* don't save zombie children	 */
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_XPG4_2)
1707c478bd9Sstevel@tonic-gate /*
1717c478bd9Sstevel@tonic-gate  * use of these symbols by applications is injurious
1727c478bd9Sstevel@tonic-gate  *	to binary compatibility
1737c478bd9Sstevel@tonic-gate  */
1747c478bd9Sstevel@tonic-gate #define	NSIG	49	/* valid signals range from 1 to NSIG-1 */
1757c478bd9Sstevel@tonic-gate #define	MAXSIG	48	/* size of u_signal[], NSIG-1 <= MAXSIG */
1767c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || !defined(_XPG4_2) */
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate #define	MINSIGSTKSZ	2048
1797c478bd9Sstevel@tonic-gate #define	SIGSTKSZ	8192
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate #define	SS_ONSTACK	0x00000001
1827c478bd9Sstevel@tonic-gate #define	SS_DISABLE	0x00000002
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate /* Duplicated in <sys/ucontext.h> as a result of XPG4v2 requirements. */
1857c478bd9Sstevel@tonic-gate #ifndef	_STACK_T
1867c478bd9Sstevel@tonic-gate #define	_STACK_T
1877c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || !defined(_XPG4_2)
1887c478bd9Sstevel@tonic-gate typedef struct sigaltstack {
1897c478bd9Sstevel@tonic-gate #else
1907c478bd9Sstevel@tonic-gate typedef struct {
1917c478bd9Sstevel@tonic-gate #endif
1927c478bd9Sstevel@tonic-gate 	void	*ss_sp;
1937c478bd9Sstevel@tonic-gate 	size_t	ss_size;
1947c478bd9Sstevel@tonic-gate 	int	ss_flags;
1957c478bd9Sstevel@tonic-gate } stack_t;
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user sigaltstack structure */
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate typedef struct sigaltstack32 {
2027c478bd9Sstevel@tonic-gate 	caddr32_t	ss_sp;
2037c478bd9Sstevel@tonic-gate 	size32_t	ss_size;
2047c478bd9Sstevel@tonic-gate 	int32_t		ss_flags;
2057c478bd9Sstevel@tonic-gate } stack32_t;
2067c478bd9Sstevel@tonic-gate 
2077c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32 */
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate #endif /* _STACK_T */
2107c478bd9Sstevel@tonic-gate 
2117c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
2147c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX))
2157c478bd9Sstevel@tonic-gate 
216*f841f6adSraf /* signotify id used only by libc for mq_notify()/aio_notify() */
2177c478bd9Sstevel@tonic-gate typedef struct signotify_id {		/* signotify id struct		*/
2187c478bd9Sstevel@tonic-gate 	pid_t	sn_pid;			/* pid of proc to be notified	*/
2197c478bd9Sstevel@tonic-gate 	int	sn_index;		/* index in preallocated pool	*/
2207c478bd9Sstevel@tonic-gate 	int	sn_pad;			/* reserved			*/
2217c478bd9Sstevel@tonic-gate } signotify_id_t;
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
2247c478bd9Sstevel@tonic-gate 
2257c478bd9Sstevel@tonic-gate /* Kernel view of the ILP32 user signotify_id structure */
2267c478bd9Sstevel@tonic-gate 
2277c478bd9Sstevel@tonic-gate typedef struct signotify32_id {
2287c478bd9Sstevel@tonic-gate 	pid32_t	sn_pid;			/* pid of proc to be notified */
2297c478bd9Sstevel@tonic-gate 	int32_t	sn_index;		/* index in preallocated pool */
2307c478bd9Sstevel@tonic-gate 	int32_t	sn_pad;			/* reserved */
2317c478bd9Sstevel@tonic-gate } signotify32_id_t;
2327c478bd9Sstevel@tonic-gate 
2337c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate /* Command codes for sig_notify call */
2367c478bd9Sstevel@tonic-gate 
2377c478bd9Sstevel@tonic-gate #define	SN_PROC		1		/* queue signotify for process	*/
2387c478bd9Sstevel@tonic-gate #define	SN_CANCEL	2		/* cancel the queued signotify	*/
2397c478bd9Sstevel@tonic-gate #define	SN_SEND		3		/* send the notified signal	*/
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate /* Added as per XPG4v2 */
2447c478bd9Sstevel@tonic-gate #if defined(__EXTENSIONS__) || defined(_KERNEL) || \
2457c478bd9Sstevel@tonic-gate 	(!defined(_STRICT_STDC) && !defined(__XOPEN_OR_POSIX)) || \
2467c478bd9Sstevel@tonic-gate 	defined(_XPG4_2)
2477c478bd9Sstevel@tonic-gate struct sigstack {
2487c478bd9Sstevel@tonic-gate 	void	*ss_sp;
2497c478bd9Sstevel@tonic-gate 	int	ss_onstack;
2507c478bd9Sstevel@tonic-gate };
2517c478bd9Sstevel@tonic-gate #endif /* defined(__EXTENSIONS__) || defined(_KERNEL) ... */
2527c478bd9Sstevel@tonic-gate 
2537c478bd9Sstevel@tonic-gate /*
2547c478bd9Sstevel@tonic-gate  * For definition of ucontext_t; must follow struct definition
2557c478bd9Sstevel@tonic-gate  * for  sigset_t
2567c478bd9Sstevel@tonic-gate  */
2577c478bd9Sstevel@tonic-gate #if defined(_XPG4_2)
2587c478bd9Sstevel@tonic-gate #include <sys/ucontext.h>
2597c478bd9Sstevel@tonic-gate #endif /* defined(_XPG4_2) */
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate #ifdef _KERNEL
2627c478bd9Sstevel@tonic-gate #include <sys/t_lock.h>
2637c478bd9Sstevel@tonic-gate 
2647c478bd9Sstevel@tonic-gate extern k_sigset_t
2657c478bd9Sstevel@tonic-gate 	nullsmask,		/* a null signal mask */
2667c478bd9Sstevel@tonic-gate 	fillset,		/* valid signals, guaranteed contiguous */
2677c478bd9Sstevel@tonic-gate 	holdvfork,		/* held while doing vfork */
2687c478bd9Sstevel@tonic-gate 	cantmask,		/* cannot be caught or ignored */
2697c478bd9Sstevel@tonic-gate 	cantreset,		/* cannot be reset after catching */
2707c478bd9Sstevel@tonic-gate 	ignoredefault,		/* ignored by default */
2717c478bd9Sstevel@tonic-gate 	stopdefault,		/* stop by default */
2727c478bd9Sstevel@tonic-gate 	coredefault;		/* dumps core by default */
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate #define	sigmask(n)		((unsigned int)1 << (((n) - 1) & (32 - 1)))
2757c478bd9Sstevel@tonic-gate #define	sigword(n)		(((unsigned int)((n) - 1))>>5)
2767c478bd9Sstevel@tonic-gate 
2777c478bd9Sstevel@tonic-gate #if	((MAXSIG > 32) && (MAXSIG <= 64))
2787c478bd9Sstevel@tonic-gate #define	FILLSET0	0xffffffffu
2797c478bd9Sstevel@tonic-gate #define	FILLSET1	((1u << (MAXSIG - 32)) - 1)
2807c478bd9Sstevel@tonic-gate #else
2817c478bd9Sstevel@tonic-gate #error "fix me: MAXSIG out of bounds"
2827c478bd9Sstevel@tonic-gate #endif
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate #define	CANTMASK0	(sigmask(SIGKILL)|sigmask(SIGSTOP))
2857c478bd9Sstevel@tonic-gate #define	CANTMASK1	0
2867c478bd9Sstevel@tonic-gate 
2877c478bd9Sstevel@tonic-gate #define	sigemptyset(s)		(*(s) = nullsmask)
2887c478bd9Sstevel@tonic-gate #define	sigfillset(s)		(*(s) = fillset)
2897c478bd9Sstevel@tonic-gate #define	sigaddset(s, n)		((s)->__sigbits[sigword(n)] |= sigmask(n))
2907c478bd9Sstevel@tonic-gate #define	sigdelset(s, n)		((s)->__sigbits[sigword(n)] &= ~sigmask(n))
2917c478bd9Sstevel@tonic-gate #define	sigismember(s, n)	(sigmask(n) & (s)->__sigbits[sigword(n)])
2927c478bd9Sstevel@tonic-gate #define	sigisempty(s)		(!(((s)->__sigbits[0]) | ((s)->__sigbits[1])))
2937c478bd9Sstevel@tonic-gate #define	sigutok(us, ks)		\
2947c478bd9Sstevel@tonic-gate 	((ks)->__sigbits[0] = (us)->__sigbits[0] & (FILLSET0 & ~CANTMASK0), \
2957c478bd9Sstevel@tonic-gate 	    (ks)->__sigbits[1] = (us)->__sigbits[1] & (FILLSET1 & ~CANTMASK1))
2967c478bd9Sstevel@tonic-gate #define	sigktou(ks, us)		((us)->__sigbits[0] = (ks)->__sigbits[0], \
2977c478bd9Sstevel@tonic-gate 				    (us)->__sigbits[1] = (ks)->__sigbits[1], \
2987c478bd9Sstevel@tonic-gate 				    (us)->__sigbits[2] = 0, \
2997c478bd9Sstevel@tonic-gate 				    (us)->__sigbits[3] = 0)
3007c478bd9Sstevel@tonic-gate typedef struct {
3017c478bd9Sstevel@tonic-gate 	int	sig;				/* signal no.		*/
3027c478bd9Sstevel@tonic-gate 	int	perm;				/* flag for EPERM	*/
3037c478bd9Sstevel@tonic-gate 	int	checkperm;			/* check perm or not	*/
3047c478bd9Sstevel@tonic-gate 	int	sicode;				/* has siginfo.si_code	*/
3057c478bd9Sstevel@tonic-gate 	union sigval value;			/* user specified value	*/
3067c478bd9Sstevel@tonic-gate } sigsend_t;
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate typedef struct {
3097c478bd9Sstevel@tonic-gate 	sigqueue_t	sn_sigq;	/* sigq struct for notification */
3107c478bd9Sstevel@tonic-gate 	u_longlong_t	sn_snid;	/* unique id for notification	*/
3117c478bd9Sstevel@tonic-gate } signotifyq_t;
3127c478bd9Sstevel@tonic-gate 
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate typedef struct sigqhdr {		/* sigqueue pool header		*/
3157c478bd9Sstevel@tonic-gate 	sigqueue_t	*sqb_free;	/* free sigq struct list	*/
3167c478bd9Sstevel@tonic-gate 	uchar_t		sqb_count;	/* sigq free count		*/
3177c478bd9Sstevel@tonic-gate 	uchar_t		sqb_maxcount;	/* sigq max free count		*/
3187c478bd9Sstevel@tonic-gate 	ushort_t	sqb_size;	/* size of header+free structs	*/
3197c478bd9Sstevel@tonic-gate 	uchar_t		sqb_pexited;	/* process has exited		*/
3207c478bd9Sstevel@tonic-gate 	uchar_t		sqb_sent;	/* number of sigq sent		*/
321*f841f6adSraf 	kcondvar_t	sqb_cv;		/* waiting for a sigq struct	*/
3227c478bd9Sstevel@tonic-gate 	kmutex_t	sqb_lock;	/* lock for sigq pool		*/
3237c478bd9Sstevel@tonic-gate } sigqhdr_t;
3247c478bd9Sstevel@tonic-gate 
3257c478bd9Sstevel@tonic-gate #define	_SIGQUEUE_MAX	32
3267c478bd9Sstevel@tonic-gate #define	_SIGNOTIFY_MAX	32
3277c478bd9Sstevel@tonic-gate 
3287c478bd9Sstevel@tonic-gate extern	void	setsigact(int, void (*)(int), k_sigset_t, int);
3297c478bd9Sstevel@tonic-gate extern	void	sigorset(k_sigset_t *, k_sigset_t *);
3307c478bd9Sstevel@tonic-gate extern	void	sigandset(k_sigset_t *, k_sigset_t *);
3317c478bd9Sstevel@tonic-gate extern	void	sigdiffset(k_sigset_t *, k_sigset_t *);
3327c478bd9Sstevel@tonic-gate extern	void	sigintr(k_sigset_t *, int);
3337c478bd9Sstevel@tonic-gate extern	void	sigunintr(k_sigset_t *);
3347c478bd9Sstevel@tonic-gate extern	void	sigreplace(k_sigset_t *, k_sigset_t *);
3357c478bd9Sstevel@tonic-gate 
3367c478bd9Sstevel@tonic-gate extern	int	kill(pid_t, int);
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate #endif /* _KERNEL */
3397c478bd9Sstevel@tonic-gate 
3407c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3417c478bd9Sstevel@tonic-gate }
3427c478bd9Sstevel@tonic-gate #endif
3437c478bd9Sstevel@tonic-gate 
3447c478bd9Sstevel@tonic-gate #endif /* _SYS_SIGNAL_H */
345