1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28*0Sstevel@tonic-gate /* All Rights Reserved */ 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #ifndef _SYS_SIGINFO_H 31*0Sstevel@tonic-gate #define _SYS_SIGINFO_H 32*0Sstevel@tonic-gate 33*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 34*0Sstevel@tonic-gate 35*0Sstevel@tonic-gate #include <sys/feature_tests.h> 36*0Sstevel@tonic-gate #include <sys/types.h> 37*0Sstevel@tonic-gate 38*0Sstevel@tonic-gate #ifdef __cplusplus 39*0Sstevel@tonic-gate extern "C" { 40*0Sstevel@tonic-gate #endif 41*0Sstevel@tonic-gate 42*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \ 43*0Sstevel@tonic-gate defined(__EXTENSIONS__) 44*0Sstevel@tonic-gate 45*0Sstevel@tonic-gate /* 46*0Sstevel@tonic-gate * The union sigval is also defined in <time.h> as per X/Open and 47*0Sstevel@tonic-gate * POSIX requirements. 48*0Sstevel@tonic-gate */ 49*0Sstevel@tonic-gate #ifndef _SIGVAL 50*0Sstevel@tonic-gate #define _SIGVAL 51*0Sstevel@tonic-gate union sigval { 52*0Sstevel@tonic-gate int sival_int; /* integer value */ 53*0Sstevel@tonic-gate void *sival_ptr; /* pointer value */ 54*0Sstevel@tonic-gate }; 55*0Sstevel@tonic-gate #endif /* _SIGVAL */ 56*0Sstevel@tonic-gate 57*0Sstevel@tonic-gate #if defined(_SYSCALL32) 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate /* Kernel view of user ILP32 sigval */ 60*0Sstevel@tonic-gate 61*0Sstevel@tonic-gate union sigval32 { 62*0Sstevel@tonic-gate int32_t sival_int; /* integer value */ 63*0Sstevel@tonic-gate caddr32_t sival_ptr; /* pointer value */ 64*0Sstevel@tonic-gate }; 65*0Sstevel@tonic-gate 66*0Sstevel@tonic-gate #endif /* _SYSCALL32 */ 67*0Sstevel@tonic-gate 68*0Sstevel@tonic-gate #else /* needed in siginfo_t structure */ 69*0Sstevel@tonic-gate 70*0Sstevel@tonic-gate union __sigval { 71*0Sstevel@tonic-gate int __sival_int; /* integer value */ 72*0Sstevel@tonic-gate void *__sival_ptr; /* pointer value */ 73*0Sstevel@tonic-gate }; 74*0Sstevel@tonic-gate 75*0Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */ 76*0Sstevel@tonic-gate 77*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \ 78*0Sstevel@tonic-gate defined(__EXTENSIONS__) 79*0Sstevel@tonic-gate 80*0Sstevel@tonic-gate /* 81*0Sstevel@tonic-gate * The sigevent structure is also defined in <time.h> as per X/Open and 82*0Sstevel@tonic-gate * POSIX requirements. 83*0Sstevel@tonic-gate */ 84*0Sstevel@tonic-gate #ifndef _SIGEVENT 85*0Sstevel@tonic-gate #define _SIGEVENT 86*0Sstevel@tonic-gate struct sigevent { 87*0Sstevel@tonic-gate int sigev_notify; /* notification mode */ 88*0Sstevel@tonic-gate int sigev_signo; /* signal number */ 89*0Sstevel@tonic-gate union sigval sigev_value; /* signal value */ 90*0Sstevel@tonic-gate void (*sigev_notify_function)(union sigval); 91*0Sstevel@tonic-gate pthread_attr_t *sigev_notify_attributes; 92*0Sstevel@tonic-gate int __sigev_pad2; 93*0Sstevel@tonic-gate }; 94*0Sstevel@tonic-gate #endif /* _SIGEVENT */ 95*0Sstevel@tonic-gate 96*0Sstevel@tonic-gate /* values of sigev_notify */ 97*0Sstevel@tonic-gate #define SIGEV_NONE 1 /* no notification */ 98*0Sstevel@tonic-gate #define SIGEV_SIGNAL 2 /* queued signal notification */ 99*0Sstevel@tonic-gate #define SIGEV_THREAD 3 /* call back from another thread */ 100*0Sstevel@tonic-gate #define SIGEV_PORT 4 /* use event port for notification */ 101*0Sstevel@tonic-gate 102*0Sstevel@tonic-gate #if defined(_SYSCALL32) 103*0Sstevel@tonic-gate 104*0Sstevel@tonic-gate /* Kernel view of user ILP32 sigevent */ 105*0Sstevel@tonic-gate 106*0Sstevel@tonic-gate struct sigevent32 { 107*0Sstevel@tonic-gate int32_t sigev_notify; /* notification mode */ 108*0Sstevel@tonic-gate int32_t sigev_signo; /* signal number */ 109*0Sstevel@tonic-gate union sigval32 sigev_value; /* signal value */ 110*0Sstevel@tonic-gate caddr32_t sigev_notify_function; 111*0Sstevel@tonic-gate caddr32_t sigev_notify_attributes; 112*0Sstevel@tonic-gate int32_t __sigev_pad2; 113*0Sstevel@tonic-gate }; 114*0Sstevel@tonic-gate 115*0Sstevel@tonic-gate #endif /* _SYSCALL32 */ 116*0Sstevel@tonic-gate 117*0Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2)... */ 118*0Sstevel@tonic-gate 119*0Sstevel@tonic-gate #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \ 120*0Sstevel@tonic-gate defined(__EXTENSIONS__) 121*0Sstevel@tonic-gate /* 122*0Sstevel@tonic-gate * negative signal codes are reserved for future use for user generated 123*0Sstevel@tonic-gate * signals 124*0Sstevel@tonic-gate */ 125*0Sstevel@tonic-gate 126*0Sstevel@tonic-gate #define SI_FROMUSER(sip) ((sip)->si_code <= 0) 127*0Sstevel@tonic-gate #define SI_FROMKERNEL(sip) ((sip)->si_code > 0) 128*0Sstevel@tonic-gate 129*0Sstevel@tonic-gate #define SI_NOINFO 32767 /* no signal information */ 130*0Sstevel@tonic-gate #define SI_DTRACE 2050 /* kernel generated signal via DTrace action */ 131*0Sstevel@tonic-gate #define SI_RCTL 2049 /* kernel generated signal via rctl action */ 132*0Sstevel@tonic-gate #define SI_USER 0 /* user generated signal via kill() */ 133*0Sstevel@tonic-gate #define SI_LWP (-1) /* user generated signal via lwp_kill() */ 134*0Sstevel@tonic-gate #define SI_QUEUE (-2) /* user generated signal via sigqueue() */ 135*0Sstevel@tonic-gate #define SI_TIMER (-3) /* from timer expiration */ 136*0Sstevel@tonic-gate #define SI_ASYNCIO (-4) /* from asynchronous I/O completion */ 137*0Sstevel@tonic-gate #define SI_MESGQ (-5) /* from message arrival */ 138*0Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2)... */ 139*0Sstevel@tonic-gate 140*0Sstevel@tonic-gate #if !defined(_POSIX_C_SOURCE) || defined(_XPG4_2) || defined(__EXTENSIONS__) 141*0Sstevel@tonic-gate /* 142*0Sstevel@tonic-gate * Get the machine dependent signal codes (SIGILL, SIGFPE, SIGSEGV, and 143*0Sstevel@tonic-gate * SIGBUS) from <sys/machsig.h> 144*0Sstevel@tonic-gate */ 145*0Sstevel@tonic-gate 146*0Sstevel@tonic-gate #include <sys/machsig.h> 147*0Sstevel@tonic-gate 148*0Sstevel@tonic-gate /* 149*0Sstevel@tonic-gate * SIGTRAP signal codes 150*0Sstevel@tonic-gate */ 151*0Sstevel@tonic-gate 152*0Sstevel@tonic-gate #define TRAP_BRKPT 1 /* breakpoint trap */ 153*0Sstevel@tonic-gate #define TRAP_TRACE 2 /* trace trap */ 154*0Sstevel@tonic-gate #define TRAP_RWATCH 3 /* read access watchpoint trap */ 155*0Sstevel@tonic-gate #define TRAP_WWATCH 4 /* write access watchpoint trap */ 156*0Sstevel@tonic-gate #define TRAP_XWATCH 5 /* execute access watchpoint trap */ 157*0Sstevel@tonic-gate #define TRAP_DTRACE 6 /* problem with fasttrap DTrace provider */ 158*0Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) 159*0Sstevel@tonic-gate #define NSIGTRAP 6 160*0Sstevel@tonic-gate #endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */ 161*0Sstevel@tonic-gate 162*0Sstevel@tonic-gate /* 163*0Sstevel@tonic-gate * SIGCLD signal codes 164*0Sstevel@tonic-gate */ 165*0Sstevel@tonic-gate 166*0Sstevel@tonic-gate #define CLD_EXITED 1 /* child has exited */ 167*0Sstevel@tonic-gate #define CLD_KILLED 2 /* child was killed */ 168*0Sstevel@tonic-gate #define CLD_DUMPED 3 /* child has coredumped */ 169*0Sstevel@tonic-gate #define CLD_TRAPPED 4 /* traced child has stopped */ 170*0Sstevel@tonic-gate #define CLD_STOPPED 5 /* child has stopped on signal */ 171*0Sstevel@tonic-gate #define CLD_CONTINUED 6 /* stopped child has continued */ 172*0Sstevel@tonic-gate 173*0Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) 174*0Sstevel@tonic-gate #define NSIGCLD 6 175*0Sstevel@tonic-gate #endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */ 176*0Sstevel@tonic-gate 177*0Sstevel@tonic-gate /* 178*0Sstevel@tonic-gate * SIGPOLL signal codes 179*0Sstevel@tonic-gate */ 180*0Sstevel@tonic-gate 181*0Sstevel@tonic-gate #define POLL_IN 1 /* input available */ 182*0Sstevel@tonic-gate #define POLL_OUT 2 /* output possible */ 183*0Sstevel@tonic-gate #define POLL_MSG 3 /* message available */ 184*0Sstevel@tonic-gate #define POLL_ERR 4 /* I/O error */ 185*0Sstevel@tonic-gate #define POLL_PRI 5 /* high priority input available */ 186*0Sstevel@tonic-gate #define POLL_HUP 6 /* device disconnected */ 187*0Sstevel@tonic-gate 188*0Sstevel@tonic-gate #if !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) 189*0Sstevel@tonic-gate #define NSIGPOLL 6 190*0Sstevel@tonic-gate #endif /* !defined(_XOPEN_SOURCE) || defined(__EXTENSIONS__) */ 191*0Sstevel@tonic-gate 192*0Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || defined(_XPG4_2) ... */ 193*0Sstevel@tonic-gate 194*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 195*0Sstevel@tonic-gate /* 196*0Sstevel@tonic-gate * SIGPROF signal codes 197*0Sstevel@tonic-gate */ 198*0Sstevel@tonic-gate 199*0Sstevel@tonic-gate #define PROF_SIG 1 /* have to set code non-zero */ 200*0Sstevel@tonic-gate #define NSIGPROF 1 201*0Sstevel@tonic-gate 202*0Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined (__EXTENSIONS__) */ 203*0Sstevel@tonic-gate 204*0Sstevel@tonic-gate #if !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) || \ 205*0Sstevel@tonic-gate defined(__EXTENSIONS__) 206*0Sstevel@tonic-gate 207*0Sstevel@tonic-gate #ifdef _LP64 208*0Sstevel@tonic-gate #define SI_MAXSZ 256 209*0Sstevel@tonic-gate #define SI_PAD ((SI_MAXSZ / sizeof (int)) - 4) 210*0Sstevel@tonic-gate #else 211*0Sstevel@tonic-gate #define SI_MAXSZ 128 212*0Sstevel@tonic-gate #define SI_PAD ((SI_MAXSZ / sizeof (int)) - 3) 213*0Sstevel@tonic-gate #endif 214*0Sstevel@tonic-gate 215*0Sstevel@tonic-gate /* 216*0Sstevel@tonic-gate * Inclusion of <sys/time_impl.h> is needed for the declaration of 217*0Sstevel@tonic-gate * timestruc_t. However, since inclusion of <sys/time_impl.h> results 218*0Sstevel@tonic-gate * in X/Open and POSIX namespace pollution, the definition for 219*0Sstevel@tonic-gate * timestruct_t has been duplicated in a standards namespace safe header 220*0Sstevel@tonic-gate * <sys/time_std_impl.h>. In <sys/time_std_impl.h>, the structure 221*0Sstevel@tonic-gate * name, tag, and member names, as well as the type itself, all have 222*0Sstevel@tonic-gate * leading underscores to protect namespace. 223*0Sstevel@tonic-gate */ 224*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 225*0Sstevel@tonic-gate #include <sys/time_impl.h> 226*0Sstevel@tonic-gate #else 227*0Sstevel@tonic-gate #include <sys/time_std_impl.h> 228*0Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ 229*0Sstevel@tonic-gate 230*0Sstevel@tonic-gate /* 231*0Sstevel@tonic-gate * The inclusion of <sys/types.h> is needed for definitions of pid_t, etc. 232*0Sstevel@tonic-gate * Placement here is due to a dependency in <sys/select.h> which is included 233*0Sstevel@tonic-gate * by <sys/types.h> for the sigevent structure. Hence this inclusion must 234*0Sstevel@tonic-gate * follow that definition. 235*0Sstevel@tonic-gate */ 236*0Sstevel@tonic-gate #include <sys/types.h> /* for definitions of pid_t, etc. */ 237*0Sstevel@tonic-gate 238*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 239*0Sstevel@tonic-gate typedef struct siginfo { /* pollutes POSIX/XOPEN namespace */ 240*0Sstevel@tonic-gate #else 241*0Sstevel@tonic-gate typedef struct { 242*0Sstevel@tonic-gate #endif 243*0Sstevel@tonic-gate int si_signo; /* signal from signal.h */ 244*0Sstevel@tonic-gate int si_code; /* code from above */ 245*0Sstevel@tonic-gate int si_errno; /* error from errno.h */ 246*0Sstevel@tonic-gate #ifdef _LP64 247*0Sstevel@tonic-gate int si_pad; /* _LP64 union starts on an 8-byte boundary */ 248*0Sstevel@tonic-gate #endif 249*0Sstevel@tonic-gate union { 250*0Sstevel@tonic-gate 251*0Sstevel@tonic-gate int __pad[SI_PAD]; /* for future growth */ 252*0Sstevel@tonic-gate 253*0Sstevel@tonic-gate struct { /* kill(), SIGCLD, siqqueue() */ 254*0Sstevel@tonic-gate pid_t __pid; /* process ID */ 255*0Sstevel@tonic-gate union { 256*0Sstevel@tonic-gate struct { 257*0Sstevel@tonic-gate uid_t __uid; 258*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || (_POSIX_C_SOURCE > 2) || \ 259*0Sstevel@tonic-gate defined(__EXTENSIONS__) 260*0Sstevel@tonic-gate union sigval __value; 261*0Sstevel@tonic-gate #else 262*0Sstevel@tonic-gate union __sigval __value; 263*0Sstevel@tonic-gate #endif 264*0Sstevel@tonic-gate } __kill; 265*0Sstevel@tonic-gate struct { 266*0Sstevel@tonic-gate clock_t __utime; 267*0Sstevel@tonic-gate int __status; 268*0Sstevel@tonic-gate clock_t __stime; 269*0Sstevel@tonic-gate } __cld; 270*0Sstevel@tonic-gate } __pdata; 271*0Sstevel@tonic-gate ctid_t __ctid; /* contract ID */ 272*0Sstevel@tonic-gate zoneid_t __zoneid; /* zone ID */ 273*0Sstevel@tonic-gate } __proc; 274*0Sstevel@tonic-gate 275*0Sstevel@tonic-gate struct { /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */ 276*0Sstevel@tonic-gate void *__addr; /* faulting address */ 277*0Sstevel@tonic-gate int __trapno; /* illegal trap number */ 278*0Sstevel@tonic-gate caddr_t __pc; /* instruction address */ 279*0Sstevel@tonic-gate } __fault; 280*0Sstevel@tonic-gate 281*0Sstevel@tonic-gate struct { /* SIGPOLL, SIGXFSZ */ 282*0Sstevel@tonic-gate /* fd not currently available for SIGPOLL */ 283*0Sstevel@tonic-gate int __fd; /* file descriptor */ 284*0Sstevel@tonic-gate long __band; 285*0Sstevel@tonic-gate } __file; 286*0Sstevel@tonic-gate 287*0Sstevel@tonic-gate struct { /* SIGPROF */ 288*0Sstevel@tonic-gate caddr_t __faddr; /* last fault address */ 289*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 290*0Sstevel@tonic-gate timestruc_t __tstamp; /* real time stamp */ 291*0Sstevel@tonic-gate #else 292*0Sstevel@tonic-gate _timestruc_t __tstamp; /* real time stamp */ 293*0Sstevel@tonic-gate #endif 294*0Sstevel@tonic-gate short __syscall; /* current syscall */ 295*0Sstevel@tonic-gate char __nsysarg; /* number of arguments */ 296*0Sstevel@tonic-gate char __fault; /* last fault type */ 297*0Sstevel@tonic-gate long __sysarg[8]; /* syscall arguments */ 298*0Sstevel@tonic-gate int __mstate[10]; /* see <sys/msacct.h> */ 299*0Sstevel@tonic-gate } __prof; 300*0Sstevel@tonic-gate 301*0Sstevel@tonic-gate struct { /* SI_RCTL */ 302*0Sstevel@tonic-gate int32_t __entity; /* type of entity exceeding */ 303*0Sstevel@tonic-gate } __rctl; 304*0Sstevel@tonic-gate } __data; 305*0Sstevel@tonic-gate 306*0Sstevel@tonic-gate } siginfo_t; 307*0Sstevel@tonic-gate 308*0Sstevel@tonic-gate #if defined(_SYSCALL32) 309*0Sstevel@tonic-gate 310*0Sstevel@tonic-gate /* Kernel view of user ILP32 siginfo struct */ 311*0Sstevel@tonic-gate 312*0Sstevel@tonic-gate #define SI32_MAXSZ 128 313*0Sstevel@tonic-gate #define SI32_PAD ((SI32_MAXSZ / sizeof (int32_t)) - 3) 314*0Sstevel@tonic-gate 315*0Sstevel@tonic-gate typedef struct siginfo32 { 316*0Sstevel@tonic-gate 317*0Sstevel@tonic-gate int32_t si_signo; /* signal from signal.h */ 318*0Sstevel@tonic-gate int32_t si_code; /* code from above */ 319*0Sstevel@tonic-gate int32_t si_errno; /* error from errno.h */ 320*0Sstevel@tonic-gate 321*0Sstevel@tonic-gate union { 322*0Sstevel@tonic-gate 323*0Sstevel@tonic-gate int32_t __pad[SI32_PAD]; /* for future growth */ 324*0Sstevel@tonic-gate 325*0Sstevel@tonic-gate struct { /* kill(), SIGCLD, siqqueue() */ 326*0Sstevel@tonic-gate pid32_t __pid; /* process ID */ 327*0Sstevel@tonic-gate union { 328*0Sstevel@tonic-gate struct { 329*0Sstevel@tonic-gate uid32_t __uid; 330*0Sstevel@tonic-gate union sigval32 __value; 331*0Sstevel@tonic-gate } __kill; 332*0Sstevel@tonic-gate struct { 333*0Sstevel@tonic-gate clock32_t __utime; 334*0Sstevel@tonic-gate int32_t __status; 335*0Sstevel@tonic-gate clock32_t __stime; 336*0Sstevel@tonic-gate } __cld; 337*0Sstevel@tonic-gate } __pdata; 338*0Sstevel@tonic-gate id32_t __ctid; /* contract ID */ 339*0Sstevel@tonic-gate id32_t __zoneid; /* zone ID */ 340*0Sstevel@tonic-gate } __proc; 341*0Sstevel@tonic-gate 342*0Sstevel@tonic-gate struct { /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */ 343*0Sstevel@tonic-gate caddr32_t __addr; /* faulting address */ 344*0Sstevel@tonic-gate int32_t __trapno; /* illegal trap number */ 345*0Sstevel@tonic-gate caddr32_t __pc; /* instruction address */ 346*0Sstevel@tonic-gate } __fault; 347*0Sstevel@tonic-gate 348*0Sstevel@tonic-gate struct { /* SIGPOLL, SIGXFSZ */ 349*0Sstevel@tonic-gate /* fd not currently available for SIGPOLL */ 350*0Sstevel@tonic-gate int32_t __fd; /* file descriptor */ 351*0Sstevel@tonic-gate int32_t __band; 352*0Sstevel@tonic-gate } __file; 353*0Sstevel@tonic-gate 354*0Sstevel@tonic-gate struct { /* SIGPROF */ 355*0Sstevel@tonic-gate caddr32_t __faddr; /* last fault address */ 356*0Sstevel@tonic-gate timestruc32_t __tstamp; /* real time stamp */ 357*0Sstevel@tonic-gate int16_t __syscall; /* current syscall */ 358*0Sstevel@tonic-gate int8_t __nsysarg; /* number of arguments */ 359*0Sstevel@tonic-gate int8_t __fault; /* last fault type */ 360*0Sstevel@tonic-gate int32_t __sysarg[8]; /* syscall arguments */ 361*0Sstevel@tonic-gate int32_t __mstate[10]; /* see <sys/msacct.h> */ 362*0Sstevel@tonic-gate } __prof; 363*0Sstevel@tonic-gate 364*0Sstevel@tonic-gate struct { /* SI_RCTL */ 365*0Sstevel@tonic-gate int32_t __entity; /* type of entity exceeding */ 366*0Sstevel@tonic-gate } __rctl; 367*0Sstevel@tonic-gate 368*0Sstevel@tonic-gate } __data; 369*0Sstevel@tonic-gate 370*0Sstevel@tonic-gate } siginfo32_t; 371*0Sstevel@tonic-gate 372*0Sstevel@tonic-gate #endif /* _SYSCALL32 */ 373*0Sstevel@tonic-gate 374*0Sstevel@tonic-gate /* 375*0Sstevel@tonic-gate * XXX -- internal version is identical to siginfo_t but without the padding. 376*0Sstevel@tonic-gate * This must be maintained in sync with it. 377*0Sstevel@tonic-gate */ 378*0Sstevel@tonic-gate 379*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 380*0Sstevel@tonic-gate 381*0Sstevel@tonic-gate typedef struct k_siginfo { 382*0Sstevel@tonic-gate int si_signo; /* signal from signal.h */ 383*0Sstevel@tonic-gate int si_code; /* code from above */ 384*0Sstevel@tonic-gate int si_errno; /* error from errno.h */ 385*0Sstevel@tonic-gate #ifdef _LP64 386*0Sstevel@tonic-gate int si_pad; /* _LP64 union starts on an 8-byte boundary */ 387*0Sstevel@tonic-gate #endif 388*0Sstevel@tonic-gate union { 389*0Sstevel@tonic-gate struct { /* kill(), SIGCLD, siqqueue() */ 390*0Sstevel@tonic-gate pid_t __pid; /* process ID */ 391*0Sstevel@tonic-gate union { 392*0Sstevel@tonic-gate struct { 393*0Sstevel@tonic-gate uid_t __uid; 394*0Sstevel@tonic-gate union sigval __value; 395*0Sstevel@tonic-gate } __kill; 396*0Sstevel@tonic-gate struct { 397*0Sstevel@tonic-gate clock_t __utime; 398*0Sstevel@tonic-gate int __status; 399*0Sstevel@tonic-gate clock_t __stime; 400*0Sstevel@tonic-gate } __cld; 401*0Sstevel@tonic-gate } __pdata; 402*0Sstevel@tonic-gate ctid_t __ctid; /* contract ID */ 403*0Sstevel@tonic-gate zoneid_t __zoneid; /* zone ID */ 404*0Sstevel@tonic-gate } __proc; 405*0Sstevel@tonic-gate 406*0Sstevel@tonic-gate struct { /* SIGSEGV, SIGBUS, SIGILL, SIGTRAP, SIGFPE */ 407*0Sstevel@tonic-gate void *__addr; /* faulting address */ 408*0Sstevel@tonic-gate int __trapno; /* illegal trap number */ 409*0Sstevel@tonic-gate caddr_t __pc; /* instruction address */ 410*0Sstevel@tonic-gate } __fault; 411*0Sstevel@tonic-gate 412*0Sstevel@tonic-gate struct { /* SIGPOLL, SIGXFSZ */ 413*0Sstevel@tonic-gate /* fd not currently available for SIGPOLL */ 414*0Sstevel@tonic-gate int __fd; /* file descriptor */ 415*0Sstevel@tonic-gate long __band; 416*0Sstevel@tonic-gate } __file; 417*0Sstevel@tonic-gate 418*0Sstevel@tonic-gate struct { /* SIGPROF */ 419*0Sstevel@tonic-gate caddr_t __faddr; /* last fault address */ 420*0Sstevel@tonic-gate 421*0Sstevel@tonic-gate #if !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) 422*0Sstevel@tonic-gate timestruc_t __tstamp; /* real time stamp */ 423*0Sstevel@tonic-gate #else 424*0Sstevel@tonic-gate _timestruc_t __tstamp; /* real time stamp */ 425*0Sstevel@tonic-gate #endif 426*0Sstevel@tonic-gate short __syscall; /* current syscall */ 427*0Sstevel@tonic-gate char __nsysarg; /* number of arguments */ 428*0Sstevel@tonic-gate char __fault; /* last fault type */ 429*0Sstevel@tonic-gate /* these are omitted to keep k_siginfo_t small */ 430*0Sstevel@tonic-gate /* long __sysarg[8]; */ 431*0Sstevel@tonic-gate /* int __mstate[10]; */ 432*0Sstevel@tonic-gate } __prof; 433*0Sstevel@tonic-gate 434*0Sstevel@tonic-gate struct { /* SI_RCTL */ 435*0Sstevel@tonic-gate int32_t __entity; /* type of entity exceeding */ 436*0Sstevel@tonic-gate } __rctl; 437*0Sstevel@tonic-gate 438*0Sstevel@tonic-gate } __data; 439*0Sstevel@tonic-gate 440*0Sstevel@tonic-gate } k_siginfo_t; 441*0Sstevel@tonic-gate 442*0Sstevel@tonic-gate typedef struct sigqueue { 443*0Sstevel@tonic-gate struct sigqueue *sq_next; 444*0Sstevel@tonic-gate k_siginfo_t sq_info; 445*0Sstevel@tonic-gate void (*sq_func)(struct sigqueue *); /* destructor function */ 446*0Sstevel@tonic-gate void *sq_backptr; /* pointer to the data structure */ 447*0Sstevel@tonic-gate /* associated by sq_func() */ 448*0Sstevel@tonic-gate int sq_external; /* comes from outside the contract */ 449*0Sstevel@tonic-gate } sigqueue_t; 450*0Sstevel@tonic-gate 451*0Sstevel@tonic-gate /* indication whether to queue the signal or not */ 452*0Sstevel@tonic-gate #define SI_CANQUEUE(c) ((c) <= SI_QUEUE) 453*0Sstevel@tonic-gate 454*0Sstevel@tonic-gate #endif /* !defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__) */ 455*0Sstevel@tonic-gate 456*0Sstevel@tonic-gate #define si_pid __data.__proc.__pid 457*0Sstevel@tonic-gate #define si_ctid __data.__proc.__ctid 458*0Sstevel@tonic-gate #define si_zoneid __data.__proc.__zoneid 459*0Sstevel@tonic-gate #define si_status __data.__proc.__pdata.__cld.__status 460*0Sstevel@tonic-gate #define si_stime __data.__proc.__pdata.__cld.__stime 461*0Sstevel@tonic-gate #define si_utime __data.__proc.__pdata.__cld.__utime 462*0Sstevel@tonic-gate #define si_uid __data.__proc.__pdata.__kill.__uid 463*0Sstevel@tonic-gate #define si_value __data.__proc.__pdata.__kill.__value 464*0Sstevel@tonic-gate #define si_addr __data.__fault.__addr 465*0Sstevel@tonic-gate #define si_trapno __data.__fault.__trapno 466*0Sstevel@tonic-gate #define si_trapafter __data.__fault.__trapno 467*0Sstevel@tonic-gate #define si_pc __data.__fault.__pc 468*0Sstevel@tonic-gate #define si_fd __data.__file.__fd 469*0Sstevel@tonic-gate #define si_band __data.__file.__band 470*0Sstevel@tonic-gate #define si_tstamp __data.__prof.__tstamp 471*0Sstevel@tonic-gate #define si_syscall __data.__prof.__syscall 472*0Sstevel@tonic-gate #define si_nsysarg __data.__prof.__nsysarg 473*0Sstevel@tonic-gate #define si_sysarg __data.__prof.__sysarg 474*0Sstevel@tonic-gate #define si_fault __data.__prof.__fault 475*0Sstevel@tonic-gate #define si_faddr __data.__prof.__faddr 476*0Sstevel@tonic-gate #define si_mstate __data.__prof.__mstate 477*0Sstevel@tonic-gate #define si_entity __data.__rctl.__entity 478*0Sstevel@tonic-gate 479*0Sstevel@tonic-gate #endif /* !defined(_POSIX_C_SOURCE) || (_POSIX_C_SOURCE > 2) ... */ 480*0Sstevel@tonic-gate 481*0Sstevel@tonic-gate 482*0Sstevel@tonic-gate #if defined(_SYSCALL32_IMPL) 483*0Sstevel@tonic-gate 484*0Sstevel@tonic-gate extern void siginfo_kto32(const k_siginfo_t *, siginfo32_t *); 485*0Sstevel@tonic-gate extern void siginfo_32tok(const siginfo32_t *, k_siginfo_t *); 486*0Sstevel@tonic-gate 487*0Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */ 488*0Sstevel@tonic-gate 489*0Sstevel@tonic-gate #ifdef __cplusplus 490*0Sstevel@tonic-gate } 491*0Sstevel@tonic-gate #endif 492*0Sstevel@tonic-gate 493*0Sstevel@tonic-gate #endif /* _SYS_SIGINFO_H */ 494