xref: /illumos-gate/usr/src/uts/common/sys/siginfo.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
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
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2004 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	*/
28*b4203d75SMarcel Telka /*	  All Rights Reserved	*/
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef _SYS_SIGINFO_H
317c478bd9Sstevel@tonic-gate #define	_SYS_SIGINFO_H
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate #include <sys/feature_tests.h>
347c478bd9Sstevel@tonic-gate #include <sys/types.h>
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
377c478bd9Sstevel@tonic-gate extern "C" {
387c478bd9Sstevel@tonic-gate #endif
397c478bd9Sstevel@tonic-gate 
407c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
417c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate /*
447c478bd9Sstevel@tonic-gate  * The union sigval is also defined in <time.h> as per X/Open and
457c478bd9Sstevel@tonic-gate  * POSIX requirements.
467c478bd9Sstevel@tonic-gate  */
477c478bd9Sstevel@tonic-gate #ifndef	_SIGVAL
487c478bd9Sstevel@tonic-gate #define	_SIGVAL
497c478bd9Sstevel@tonic-gate union sigval {
507c478bd9Sstevel@tonic-gate 	int	sival_int;	/* integer value */
517c478bd9Sstevel@tonic-gate 	void	*sival_ptr;	/* pointer value */
527c478bd9Sstevel@tonic-gate };
537c478bd9Sstevel@tonic-gate #endif /* _SIGVAL */
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
567c478bd9Sstevel@tonic-gate 
577c478bd9Sstevel@tonic-gate /* Kernel view of user ILP32 sigval */
587c478bd9Sstevel@tonic-gate 
597c478bd9Sstevel@tonic-gate union sigval32 {
607c478bd9Sstevel@tonic-gate 	int32_t	sival_int;	/* integer value */
617c478bd9Sstevel@tonic-gate 	caddr32_t sival_ptr;	/* pointer value */
627c478bd9Sstevel@tonic-gate };
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #else 				/* needed in siginfo_t structure */
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate union __sigval {
697c478bd9Sstevel@tonic-gate 	int	__sival_int;	/* integer value */
707c478bd9Sstevel@tonic-gate 	void	*__sival_ptr;	/* pointer value */
717c478bd9Sstevel@tonic-gate };
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
767c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /*
797c478bd9Sstevel@tonic-gate  * The sigevent structure is also defined in <time.h> as per X/Open and
807c478bd9Sstevel@tonic-gate  * POSIX requirements.
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate #ifndef	_SIGEVENT
837c478bd9Sstevel@tonic-gate #define	_SIGEVENT
847c478bd9Sstevel@tonic-gate struct sigevent {
857c478bd9Sstevel@tonic-gate 	int		sigev_notify;	/* notification mode */
867c478bd9Sstevel@tonic-gate 	int		sigev_signo;	/* signal number */
877c478bd9Sstevel@tonic-gate 	union sigval	sigev_value;	/* signal value */
887c478bd9Sstevel@tonic-gate 	void		(*sigev_notify_function)(union sigval);
897c478bd9Sstevel@tonic-gate 	pthread_attr_t	*sigev_notify_attributes;
907c478bd9Sstevel@tonic-gate 	int		__sigev_pad2;
917c478bd9Sstevel@tonic-gate };
927c478bd9Sstevel@tonic-gate #endif	/* _SIGEVENT */
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate /* values of sigev_notify */
957c478bd9Sstevel@tonic-gate #define	SIGEV_NONE	1		/* no notification */
967c478bd9Sstevel@tonic-gate #define	SIGEV_SIGNAL	2		/* queued signal notification */
977c478bd9Sstevel@tonic-gate #define	SIGEV_THREAD	3		/* call back from another thread */
987c478bd9Sstevel@tonic-gate #define	SIGEV_PORT	4		/* use event port for notification */
997c478bd9Sstevel@tonic-gate 
1007c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate /* Kernel view of user ILP32 sigevent */
1037c478bd9Sstevel@tonic-gate 
1047c478bd9Sstevel@tonic-gate struct sigevent32 {
1057c478bd9Sstevel@tonic-gate 	int32_t		sigev_notify;	/* notification mode */
1067c478bd9Sstevel@tonic-gate 	int32_t		sigev_signo;	/* signal number */
1077c478bd9Sstevel@tonic-gate 	union sigval32	sigev_value;	/* signal value */
1087c478bd9Sstevel@tonic-gate 	caddr32_t	sigev_notify_function;
1097c478bd9Sstevel@tonic-gate 	caddr32_t	sigev_notify_attributes;
1107c478bd9Sstevel@tonic-gate 	int32_t		__sigev_pad2;
1117c478bd9Sstevel@tonic-gate };
1127c478bd9Sstevel@tonic-gate 
1137c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */
1167c478bd9Sstevel@tonic-gate 
1177c478bd9Sstevel@tonic-gate #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \
1187c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
1197c478bd9Sstevel@tonic-gate /*
1207c478bd9Sstevel@tonic-gate  * negative signal codes are reserved for future use for user generated
1217c478bd9Sstevel@tonic-gate  * signals
1227c478bd9Sstevel@tonic-gate  */
1237c478bd9Sstevel@tonic-gate 
1247c478bd9Sstevel@tonic-gate #define	SI_FROMUSER(sip)	((sip)->si_code <= 0)
1257c478bd9Sstevel@tonic-gate #define	SI_FROMKERNEL(sip)	((sip)->si_code > 0)
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate #define	SI_NOINFO	32767	/* no signal information */
1287c478bd9Sstevel@tonic-gate #define	SI_DTRACE	2050	/* kernel generated signal via DTrace action */
1297c478bd9Sstevel@tonic-gate #define	SI_RCTL		2049	/* kernel generated signal via rctl action */
1307c478bd9Sstevel@tonic-gate #define	SI_USER		0	/* user generated signal via kill() */
1317c478bd9Sstevel@tonic-gate #define	SI_LWP		(-1)	/* user generated signal via lwp_kill() */
1327c478bd9Sstevel@tonic-gate #define	SI_QUEUE	(-2)	/* user generated signal via sigqueue() */
1337c478bd9Sstevel@tonic-gate #define	SI_TIMER	(-3)	/* from timer expiration */
1347c478bd9Sstevel@tonic-gate #define	SI_ASYNCIO	(-4)	/* from asynchronous I/O completion */
1357c478bd9Sstevel@tonic-gate #define	SI_MESGQ	(-5)	/* from message arrival */
1367c478bd9Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate #if !defined(_POSIX_C_SOURCE) || defined(_XPG4_2) || defined(__EXTENSIONS__)
1397c478bd9Sstevel@tonic-gate /*
1407c478bd9Sstevel@tonic-gate  * Get the machine dependent signal codes (SIGILL, SIGFPE, SIGSEGV, and
1417c478bd9Sstevel@tonic-gate  * SIGBUS) from <sys/machsig.h>
1427c478bd9Sstevel@tonic-gate  */
1437c478bd9Sstevel@tonic-gate 
1447c478bd9Sstevel@tonic-gate #include <sys/machsig.h>
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate /*
1477c478bd9Sstevel@tonic-gate  * SIGTRAP signal codes
1487c478bd9Sstevel@tonic-gate  */
1497c478bd9Sstevel@tonic-gate 
1507c478bd9Sstevel@tonic-gate #define	TRAP_BRKPT	1	/* breakpoint trap */
1517c478bd9Sstevel@tonic-gate #define	TRAP_TRACE	2	/* trace trap */
1527c478bd9Sstevel@tonic-gate #define	TRAP_RWATCH	3	/* read access watchpoint trap */
1537c478bd9Sstevel@tonic-gate #define	TRAP_WWATCH	4	/* write access watchpoint trap */
1547c478bd9Sstevel@tonic-gate #define	TRAP_XWATCH	5	/* execute access watchpoint trap */
1557c478bd9Sstevel@tonic-gate #define	TRAP_DTRACE	6	/* problem with fasttrap DTrace provider */
1567c478bd9Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1577c478bd9Sstevel@tonic-gate #define	NSIGTRAP	6
1587c478bd9Sstevel@tonic-gate #endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
1597c478bd9Sstevel@tonic-gate 
1607c478bd9Sstevel@tonic-gate /*
1617c478bd9Sstevel@tonic-gate  * SIGCLD signal codes
1627c478bd9Sstevel@tonic-gate  */
1637c478bd9Sstevel@tonic-gate 
1647c478bd9Sstevel@tonic-gate #define	CLD_EXITED	1	/* child has exited */
1657c478bd9Sstevel@tonic-gate #define	CLD_KILLED	2	/* child was killed */
1667c478bd9Sstevel@tonic-gate #define	CLD_DUMPED	3	/* child has coredumped */
1677c478bd9Sstevel@tonic-gate #define	CLD_TRAPPED	4	/* traced child has stopped */
1687c478bd9Sstevel@tonic-gate #define	CLD_STOPPED	5	/* child has stopped on signal */
1697c478bd9Sstevel@tonic-gate #define	CLD_CONTINUED	6	/* stopped child has continued */
1707c478bd9Sstevel@tonic-gate 
1717c478bd9Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1727c478bd9Sstevel@tonic-gate #define	NSIGCLD		6
1737c478bd9Sstevel@tonic-gate #endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate /*
1767c478bd9Sstevel@tonic-gate  * SIGPOLL signal codes
1777c478bd9Sstevel@tonic-gate  */
1787c478bd9Sstevel@tonic-gate 
1797c478bd9Sstevel@tonic-gate #define	POLL_IN		1	/* input available */
1807c478bd9Sstevel@tonic-gate #define	POLL_OUT	2	/* output possible */
1817c478bd9Sstevel@tonic-gate #define	POLL_MSG	3	/* message available */
1827c478bd9Sstevel@tonic-gate #define	POLL_ERR	4	/* I/O error */
1837c478bd9Sstevel@tonic-gate #define	POLL_PRI	5	/* high priority input available */
1847c478bd9Sstevel@tonic-gate #define	POLL_HUP	6	/* device disconnected */
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__)
1877c478bd9Sstevel@tonic-gate #define	NSIGPOLL	6
1887c478bd9Sstevel@tonic-gate #endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || defined(_XPG4_2) ... */
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
1937c478bd9Sstevel@tonic-gate /*
1947c478bd9Sstevel@tonic-gate  * SIGPROF signal codes
1957c478bd9Sstevel@tonic-gate  */
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate #define	PROF_SIG	1	/* have to set code non-zero */
1987c478bd9Sstevel@tonic-gate #define	NSIGPROF	1
1997c478bd9Sstevel@tonic-gate 
2007c478bd9Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined (__EXTENSIONS__) */
2017c478bd9Sstevel@tonic-gate 
2027c478bd9Sstevel@tonic-gate #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \
2037c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
2047c478bd9Sstevel@tonic-gate 
2057c478bd9Sstevel@tonic-gate #ifdef _LP64
2067c478bd9Sstevel@tonic-gate #define	SI_MAXSZ	256
2077c478bd9Sstevel@tonic-gate #define	SI_PAD		((SI_MAXSZ / sizeof (int)) - 4)
2087c478bd9Sstevel@tonic-gate #else
2097c478bd9Sstevel@tonic-gate #define	SI_MAXSZ	128
2107c478bd9Sstevel@tonic-gate #define	SI_PAD		((SI_MAXSZ / sizeof (int)) - 3)
2117c478bd9Sstevel@tonic-gate #endif
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate /*
2147c478bd9Sstevel@tonic-gate  * Inclusion of <sys/time_impl.h> is needed for the declaration of
2157c478bd9Sstevel@tonic-gate  * timestruc_t.  However, since inclusion of <sys/time_impl.h> results
2167c478bd9Sstevel@tonic-gate  * in X/Open and POSIX namespace pollution, the definition for
2177c478bd9Sstevel@tonic-gate  * timestruct_t has been duplicated in a standards namespace safe header
2187c478bd9Sstevel@tonic-gate  * <sys/time_std_impl.h>.  In <sys/time_std_impl.h>, the structure
2197c478bd9Sstevel@tonic-gate  * name, tag, and member names, as well as the type itself, all have
2207c478bd9Sstevel@tonic-gate  * leading underscores to protect namespace.
2217c478bd9Sstevel@tonic-gate  */
2227c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
2237c478bd9Sstevel@tonic-gate #include <sys/time_impl.h>
2247c478bd9Sstevel@tonic-gate #else
2257c478bd9Sstevel@tonic-gate #include <sys/time_std_impl.h>
2267c478bd9Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate /*
2297c478bd9Sstevel@tonic-gate  * The inclusion of <sys/types.h> is needed for definitions of pid_t, etc.
2307c478bd9Sstevel@tonic-gate  * Placement here is due to a dependency in <sys/select.h> which is included
2317c478bd9Sstevel@tonic-gate  * by <sys/types.h> for the sigevent structure.  Hence this inclusion must
2327c478bd9Sstevel@tonic-gate  * follow that definition.
2337c478bd9Sstevel@tonic-gate  */
2347c478bd9Sstevel@tonic-gate #include <sys/types.h>		/* for definitions of pid_t, etc. */
2357c478bd9Sstevel@tonic-gate 
2367c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
2377c478bd9Sstevel@tonic-gate typedef struct siginfo { 		/* pollutes POSIX/XOPEN namespace */
2387c478bd9Sstevel@tonic-gate #else
2397c478bd9Sstevel@tonic-gate typedef struct {
2407c478bd9Sstevel@tonic-gate #endif
2417c478bd9Sstevel@tonic-gate 	int	si_signo;			/* signal from signal.h	*/
2427c478bd9Sstevel@tonic-gate 	int 	si_code;			/* code from above	*/
2437c478bd9Sstevel@tonic-gate 	int	si_errno;			/* error from errno.h	*/
2447c478bd9Sstevel@tonic-gate #ifdef _LP64
2457c478bd9Sstevel@tonic-gate 	int	si_pad;		/* _LP64 union starts on an 8-byte boundary */
2467c478bd9Sstevel@tonic-gate #endif
2477c478bd9Sstevel@tonic-gate 	union {
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate 		int	__pad[SI_PAD];		/* for future growth	*/
2507c478bd9Sstevel@tonic-gate 
2517c478bd9Sstevel@tonic-gate 		struct {			/* kill(), SIGCLD, siqqueue() */
2527c478bd9Sstevel@tonic-gate 			pid_t	__pid;		/* process ID		*/
2537c478bd9Sstevel@tonic-gate 			union {
2547c478bd9Sstevel@tonic-gate 				struct {
2557c478bd9Sstevel@tonic-gate 					uid_t	__uid;
2567c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \
2577c478bd9Sstevel@tonic-gate 	defined(__EXTENSIONS__)
2587c478bd9Sstevel@tonic-gate 					union sigval	__value;
2597c478bd9Sstevel@tonic-gate #else
2607c478bd9Sstevel@tonic-gate 					union __sigval	__value;
2617c478bd9Sstevel@tonic-gate #endif
2627c478bd9Sstevel@tonic-gate 				} __kill;
2637c478bd9Sstevel@tonic-gate 				struct {
2647c478bd9Sstevel@tonic-gate 					clock_t __utime;
2657c478bd9Sstevel@tonic-gate 					int	__status;
2667c478bd9Sstevel@tonic-gate 					clock_t __stime;
2677c478bd9Sstevel@tonic-gate 				} __cld;
2687c478bd9Sstevel@tonic-gate 			} __pdata;
2697c478bd9Sstevel@tonic-gate 			ctid_t	__ctid;		/* contract ID		*/
2707c478bd9Sstevel@tonic-gate 			zoneid_t __zoneid;	/* zone ID		*/
2717c478bd9Sstevel@tonic-gate 		} __proc;
2727c478bd9Sstevel@tonic-gate 
2737c478bd9Sstevel@tonic-gate 		struct {	/* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
2747c478bd9Sstevel@tonic-gate 			void 	*__addr;	/* faulting address	*/
2757c478bd9Sstevel@tonic-gate 			int	__trapno;	/* illegal trap number	*/
2767c478bd9Sstevel@tonic-gate 			caddr_t	__pc;		/* instruction address	*/
2777c478bd9Sstevel@tonic-gate 		} __fault;
2787c478bd9Sstevel@tonic-gate 
2797c478bd9Sstevel@tonic-gate 		struct {			/* SIGPOLL, SIGXFSZ	*/
2807c478bd9Sstevel@tonic-gate 		/* fd not currently available for SIGPOLL */
2817c478bd9Sstevel@tonic-gate 			int	__fd;		/* file descriptor	*/
2827c478bd9Sstevel@tonic-gate 			long	__band;
2837c478bd9Sstevel@tonic-gate 		} __file;
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate 		struct {			/* SIGPROF */
2867c478bd9Sstevel@tonic-gate 			caddr_t	__faddr;	/* last fault address	*/
2877c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
2887c478bd9Sstevel@tonic-gate 			timestruc_t __tstamp;	/* real time stamp	*/
2897c478bd9Sstevel@tonic-gate #else
2907c478bd9Sstevel@tonic-gate 			_timestruc_t __tstamp;	/* real time stamp	*/
2917c478bd9Sstevel@tonic-gate #endif
2927c478bd9Sstevel@tonic-gate 			short	__syscall;	/* current syscall	*/
2937c478bd9Sstevel@tonic-gate 			char	__nsysarg;	/* number of arguments	*/
2947c478bd9Sstevel@tonic-gate 			char	__fault;	/* last fault type	*/
2957c478bd9Sstevel@tonic-gate 			long	__sysarg[8];	/* syscall arguments	*/
2967c478bd9Sstevel@tonic-gate 			int	__mstate[10];	/* see <sys/msacct.h>	*/
2977c478bd9Sstevel@tonic-gate 		} __prof;
2987c478bd9Sstevel@tonic-gate 
2997c478bd9Sstevel@tonic-gate 		struct {			/* SI_RCTL */
3007c478bd9Sstevel@tonic-gate 			int32_t	__entity;	/* type of entity exceeding */
3017c478bd9Sstevel@tonic-gate 		} __rctl;
3027c478bd9Sstevel@tonic-gate 	} __data;
3037c478bd9Sstevel@tonic-gate 
3047c478bd9Sstevel@tonic-gate } siginfo_t;
3057c478bd9Sstevel@tonic-gate 
3067c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32)
3077c478bd9Sstevel@tonic-gate 
3087c478bd9Sstevel@tonic-gate /* Kernel view of user ILP32 siginfo struct */
3097c478bd9Sstevel@tonic-gate 
3107c478bd9Sstevel@tonic-gate #define	SI32_MAXSZ	128
3117c478bd9Sstevel@tonic-gate #define	SI32_PAD	((SI32_MAXSZ / sizeof (int32_t)) - 3)
3127c478bd9Sstevel@tonic-gate 
3137c478bd9Sstevel@tonic-gate typedef struct siginfo32 {
3147c478bd9Sstevel@tonic-gate 
3157c478bd9Sstevel@tonic-gate 	int32_t	si_signo;			/* signal from signal.h	*/
3167c478bd9Sstevel@tonic-gate 	int32_t	si_code;			/* code from above	*/
3177c478bd9Sstevel@tonic-gate 	int32_t	si_errno;			/* error from errno.h	*/
3187c478bd9Sstevel@tonic-gate 
3197c478bd9Sstevel@tonic-gate 	union {
3207c478bd9Sstevel@tonic-gate 
3217c478bd9Sstevel@tonic-gate 		int32_t	__pad[SI32_PAD];	/* for future growth	*/
3227c478bd9Sstevel@tonic-gate 
3237c478bd9Sstevel@tonic-gate 		struct {			/* kill(), SIGCLD, siqqueue() */
3247c478bd9Sstevel@tonic-gate 			pid32_t	__pid;		/* process ID		*/
3257c478bd9Sstevel@tonic-gate 			union {
3267c478bd9Sstevel@tonic-gate 				struct {
3277c478bd9Sstevel@tonic-gate 					uid32_t	__uid;
3287c478bd9Sstevel@tonic-gate 					union sigval32	__value;
3297c478bd9Sstevel@tonic-gate 				} __kill;
3307c478bd9Sstevel@tonic-gate 				struct {
3317c478bd9Sstevel@tonic-gate 					clock32_t __utime;
3327c478bd9Sstevel@tonic-gate 					int32_t	__status;
3337c478bd9Sstevel@tonic-gate 					clock32_t __stime;
3347c478bd9Sstevel@tonic-gate 				} __cld;
3357c478bd9Sstevel@tonic-gate 			} __pdata;
3367c478bd9Sstevel@tonic-gate 			id32_t	__ctid;		/* contract ID		*/
3377c478bd9Sstevel@tonic-gate 			id32_t __zoneid;	/* zone ID		*/
3387c478bd9Sstevel@tonic-gate 		} __proc;
3397c478bd9Sstevel@tonic-gate 
3407c478bd9Sstevel@tonic-gate 		struct {	/* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
3417c478bd9Sstevel@tonic-gate 			caddr32_t __addr;	/* faulting address	*/
3427c478bd9Sstevel@tonic-gate 			int32_t	__trapno;	/* illegal trap number	*/
3437c478bd9Sstevel@tonic-gate 			caddr32_t __pc;		/* instruction address	*/
3447c478bd9Sstevel@tonic-gate 		} __fault;
3457c478bd9Sstevel@tonic-gate 
3467c478bd9Sstevel@tonic-gate 		struct {			/* SIGPOLL, SIGXFSZ	*/
3477c478bd9Sstevel@tonic-gate 		/* fd not currently available for SIGPOLL */
3487c478bd9Sstevel@tonic-gate 			int32_t	__fd;		/* file descriptor	*/
3497c478bd9Sstevel@tonic-gate 			int32_t	__band;
3507c478bd9Sstevel@tonic-gate 		} __file;
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate 		struct {			/* SIGPROF */
3537c478bd9Sstevel@tonic-gate 			caddr32_t __faddr;	/* last fault address	*/
3547c478bd9Sstevel@tonic-gate 			timestruc32_t __tstamp; /* real time stamp	*/
3557c478bd9Sstevel@tonic-gate 			int16_t	__syscall;	/* current syscall	*/
3567c478bd9Sstevel@tonic-gate 			int8_t	__nsysarg;	/* number of arguments	*/
3577c478bd9Sstevel@tonic-gate 			int8_t	__fault;	/* last fault type	*/
3587c478bd9Sstevel@tonic-gate 			int32_t	__sysarg[8];	/* syscall arguments	*/
3597c478bd9Sstevel@tonic-gate 			int32_t	__mstate[10];	/* see <sys/msacct.h>	*/
3607c478bd9Sstevel@tonic-gate 		} __prof;
3617c478bd9Sstevel@tonic-gate 
3627c478bd9Sstevel@tonic-gate 		struct {			/* SI_RCTL */
3637c478bd9Sstevel@tonic-gate 			int32_t	__entity;	/* type of entity exceeding */
3647c478bd9Sstevel@tonic-gate 		} __rctl;
3657c478bd9Sstevel@tonic-gate 
3667c478bd9Sstevel@tonic-gate 	} __data;
3677c478bd9Sstevel@tonic-gate 
3687c478bd9Sstevel@tonic-gate } siginfo32_t;
3697c478bd9Sstevel@tonic-gate 
3707c478bd9Sstevel@tonic-gate #endif	/* _SYSCALL32 */
3717c478bd9Sstevel@tonic-gate 
3727c478bd9Sstevel@tonic-gate /*
3737c478bd9Sstevel@tonic-gate  * XXX -- internal version is identical to siginfo_t but without the padding.
3747c478bd9Sstevel@tonic-gate  * This must be maintained in sync with it.
3757c478bd9Sstevel@tonic-gate  */
3767c478bd9Sstevel@tonic-gate 
3777c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
3787c478bd9Sstevel@tonic-gate 
3797c478bd9Sstevel@tonic-gate typedef struct k_siginfo {
3807c478bd9Sstevel@tonic-gate 	int	si_signo;			/* signal from signal.h	*/
3817c478bd9Sstevel@tonic-gate 	int 	si_code;			/* code from above	*/
3827c478bd9Sstevel@tonic-gate 	int	si_errno;			/* error from errno.h	*/
3837c478bd9Sstevel@tonic-gate #ifdef _LP64
3847c478bd9Sstevel@tonic-gate 	int	si_pad;		/* _LP64 union starts on an 8-byte boundary */
3857c478bd9Sstevel@tonic-gate #endif
3867c478bd9Sstevel@tonic-gate 	union {
3877c478bd9Sstevel@tonic-gate 		struct {			/* kill(), SIGCLD, siqqueue() */
3887c478bd9Sstevel@tonic-gate 			pid_t	__pid;		/* process ID		*/
3897c478bd9Sstevel@tonic-gate 			union {
3907c478bd9Sstevel@tonic-gate 				struct {
3917c478bd9Sstevel@tonic-gate 					uid_t	__uid;
3927c478bd9Sstevel@tonic-gate 					union sigval	__value;
3937c478bd9Sstevel@tonic-gate 				} __kill;
3947c478bd9Sstevel@tonic-gate 				struct {
3957c478bd9Sstevel@tonic-gate 					clock_t __utime;
3967c478bd9Sstevel@tonic-gate 					int	__status;
3977c478bd9Sstevel@tonic-gate 					clock_t __stime;
3987c478bd9Sstevel@tonic-gate 				} __cld;
3997c478bd9Sstevel@tonic-gate 			} __pdata;
4007c478bd9Sstevel@tonic-gate 			ctid_t	__ctid;		/* contract ID		*/
4017c478bd9Sstevel@tonic-gate 			zoneid_t __zoneid;	/* zone ID		*/
4027c478bd9Sstevel@tonic-gate 		} __proc;
4037c478bd9Sstevel@tonic-gate 
4047c478bd9Sstevel@tonic-gate 		struct {	/* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */
4057c478bd9Sstevel@tonic-gate 			void 	*__addr;	/* faulting address	*/
4067c478bd9Sstevel@tonic-gate 			int	__trapno;	/* illegal trap number	*/
4077c478bd9Sstevel@tonic-gate 			caddr_t	__pc;		/* instruction address	*/
4087c478bd9Sstevel@tonic-gate 		} __fault;
4097c478bd9Sstevel@tonic-gate 
4107c478bd9Sstevel@tonic-gate 		struct {			/* SIGPOLL, SIGXFSZ	*/
4117c478bd9Sstevel@tonic-gate 		/* fd not currently available for SIGPOLL */
4127c478bd9Sstevel@tonic-gate 			int	__fd;		/* file descriptor	*/
4137c478bd9Sstevel@tonic-gate 			long	__band;
4147c478bd9Sstevel@tonic-gate 		} __file;
4157c478bd9Sstevel@tonic-gate 
4167c478bd9Sstevel@tonic-gate 		struct {			/* SIGPROF */
4177c478bd9Sstevel@tonic-gate 			caddr_t	__faddr;	/* last fault address	*/
4187c478bd9Sstevel@tonic-gate 
4197c478bd9Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__)
4207c478bd9Sstevel@tonic-gate 			timestruc_t __tstamp;	/* real time stamp	*/
4217c478bd9Sstevel@tonic-gate #else
4227c478bd9Sstevel@tonic-gate 			_timestruc_t __tstamp;	/* real time stamp	*/
4237c478bd9Sstevel@tonic-gate #endif
4247c478bd9Sstevel@tonic-gate 			short	__syscall;	/* current syscall	*/
4257c478bd9Sstevel@tonic-gate 			char	__nsysarg;	/* number of arguments	*/
4267c478bd9Sstevel@tonic-gate 			char	__fault;	/* last fault type	*/
4277c478bd9Sstevel@tonic-gate 			/* these are omitted to keep k_siginfo_t small	*/
4287c478bd9Sstevel@tonic-gate 			/* long	__sysarg[8]; */
4297c478bd9Sstevel@tonic-gate 			/* int	__mstate[10]; */
4307c478bd9Sstevel@tonic-gate 		} __prof;
4317c478bd9Sstevel@tonic-gate 
4327c478bd9Sstevel@tonic-gate 		struct {			/* SI_RCTL */
4337c478bd9Sstevel@tonic-gate 			int32_t	__entity;	/* type of entity exceeding */
4347c478bd9Sstevel@tonic-gate 		} __rctl;
4357c478bd9Sstevel@tonic-gate 
4367c478bd9Sstevel@tonic-gate 	} __data;
4377c478bd9Sstevel@tonic-gate 
4387c478bd9Sstevel@tonic-gate } k_siginfo_t;
4397c478bd9Sstevel@tonic-gate 
4407c478bd9Sstevel@tonic-gate typedef struct sigqueue {
4417c478bd9Sstevel@tonic-gate 	struct sigqueue	*sq_next;
4427c478bd9Sstevel@tonic-gate 	k_siginfo_t	sq_info;
4437c478bd9Sstevel@tonic-gate 	void		(*sq_func)(struct sigqueue *); /* destructor function */
4447c478bd9Sstevel@tonic-gate 	void		*sq_backptr;	/* pointer to the data structure */
4457c478bd9Sstevel@tonic-gate 					/* associated by sq_func()	*/
4467c478bd9Sstevel@tonic-gate 	int		sq_external;	/* comes from outside the contract */
4477c478bd9Sstevel@tonic-gate } sigqueue_t;
4487c478bd9Sstevel@tonic-gate 
4497c478bd9Sstevel@tonic-gate /*  indication whether to queue the signal or not */
4507c478bd9Sstevel@tonic-gate #define	SI_CANQUEUE(c)	((c) <= SI_QUEUE)
4517c478bd9Sstevel@tonic-gate 
4527c478bd9Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */
4537c478bd9Sstevel@tonic-gate 
4547c478bd9Sstevel@tonic-gate #define	si_pid		__data.__proc.__pid
4557c478bd9Sstevel@tonic-gate #define	si_ctid		__data.__proc.__ctid
4567c478bd9Sstevel@tonic-gate #define	si_zoneid	__data.__proc.__zoneid
4577c478bd9Sstevel@tonic-gate #define	si_status	__data.__proc.__pdata.__cld.__status
4587c478bd9Sstevel@tonic-gate #define	si_stime	__data.__proc.__pdata.__cld.__stime
4597c478bd9Sstevel@tonic-gate #define	si_utime	__data.__proc.__pdata.__cld.__utime
4607c478bd9Sstevel@tonic-gate #define	si_uid		__data.__proc.__pdata.__kill.__uid
4617c478bd9Sstevel@tonic-gate #define	si_value	__data.__proc.__pdata.__kill.__value
4627c478bd9Sstevel@tonic-gate #define	si_addr		__data.__fault.__addr
4637c478bd9Sstevel@tonic-gate #define	si_trapno	__data.__fault.__trapno
4647c478bd9Sstevel@tonic-gate #define	si_trapafter	__data.__fault.__trapno
4657c478bd9Sstevel@tonic-gate #define	si_pc		__data.__fault.__pc
4667c478bd9Sstevel@tonic-gate #define	si_fd		__data.__file.__fd
4677c478bd9Sstevel@tonic-gate #define	si_band		__data.__file.__band
4687c478bd9Sstevel@tonic-gate #define	si_tstamp	__data.__prof.__tstamp
4697c478bd9Sstevel@tonic-gate #define	si_syscall	__data.__prof.__syscall
4707c478bd9Sstevel@tonic-gate #define	si_nsysarg	__data.__prof.__nsysarg
4717c478bd9Sstevel@tonic-gate #define	si_sysarg	__data.__prof.__sysarg
4727c478bd9Sstevel@tonic-gate #define	si_fault	__data.__prof.__fault
4737c478bd9Sstevel@tonic-gate #define	si_faddr	__data.__prof.__faddr
4747c478bd9Sstevel@tonic-gate #define	si_mstate	__data.__prof.__mstate
4757c478bd9Sstevel@tonic-gate #define	si_entity	__data.__rctl.__entity
4767c478bd9Sstevel@tonic-gate 
4777c478bd9Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) ... */
4787c478bd9Sstevel@tonic-gate 
4797c478bd9Sstevel@tonic-gate 
4807c478bd9Sstevel@tonic-gate #if defined(_SYSCALL32_IMPL)
4817c478bd9Sstevel@tonic-gate 
4827c478bd9Sstevel@tonic-gate extern void siginfo_kto32(const k_siginfo_t *, siginfo32_t *);
4837c478bd9Sstevel@tonic-gate extern void siginfo_32tok(const siginfo32_t *, k_siginfo_t *);
4847c478bd9Sstevel@tonic-gate 
4857c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */
4867c478bd9Sstevel@tonic-gate 
4877c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
4887c478bd9Sstevel@tonic-gate }
4897c478bd9Sstevel@tonic-gate #endif
4907c478bd9Sstevel@tonic-gate 
4917c478bd9Sstevel@tonic-gate #endif	/* _SYS_SIGINFO_H */
492