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