| Current File : //usr/share/man/man3head/siginfo.h.3head |
'\" te
.\" Portions Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
.\" Copyright 1989 AT&T
.TH siginfo.h 3HEAD "18 May 2016" "SunOS 5.11" "Headers"
.SH NAME
siginfo.h, siginfo \- signal generation information
.SH SYNOPSIS
.LP
.nf
#include <siginfo.h>
.fi
.SH DESCRIPTION
.sp
.LP
If a process is catching a signal, it might request information that tells why the system generated that signal. See \fBsigaction\fR(2). If a process is monitoring its children, it might receive information that tells why a child changed state. See \fBwaitid\fR(2). In either case, the system returns the information in a structure of type \fBsiginfo_t \fR, which includes the following information:
.sp
.in +2
.nf
int si_signo /* signal number */
int si_errno /* error number */
int si_code /* signal code */
union sigval si_value /* signal value */
.fi
.in -2
.sp
.LP
\fBsi_signo\fR contains the system-generated signal number. For the \fBwaitid\fR(2) function, \fBsi_signo\fR is always \fBSIGCHLD\fR.
.sp
.LP
If \fBsi_errno\fR is non-zero, it contains an error number associated with this signal, as defined in \fB<errno.h> \fR\&.
.sp
.LP
\fBsi_code\fR contains a code identifying the cause of the signal.
.sp
.LP
If the value of the \fBsi_code\fR member is \fB SI_NOINFO,\fR only the \fBsi_signo\fR member of \fBsiginfo_t\fR is meaningful, and the value of all other members is unspecified.
.SS "User Signals"
.sp
.LP
If the value of \fBsi_code\fR is less than or equal to 0, then the signal was generated by a user process (see \fBkill\fR(2), \fB_lwp_kill\fR(2), \fBsigqueue\fR(3C), \fBsigsend\fR(2), \fBabort\fR(3C), and \fBraise\fR(3C)) and the \fBsiginfo\fR structure contains the following additional information:
.sp
.in +2
.nf
pid_t si_pid /* sending process ID */
uid_t si_uid /* sending user ID */
ctid_t si_ctid /* sending contract ID */
zoneid_t si_zoneid /* sending zone ID */S
.fi
.in -2
.sp
.LP
If the signal was generated by a user process, the following values are defined for \fBsi_code\fR:
.sp
.ne 2
.mk
.na
\fB\fBSI_USER\fR\fR
.ad
.RS 14n
.rt
The implementation sets \fBsi_code\fR to \fB SI_USER\fR if the signal was sent by \fBkill\fR(2), \fBsigsend\fR(2), \fBraise\fR(3C) or \fBabort\fR(3C).
.RE
.sp
.ne 2
.mk
.na
\fB\fBSI_LWP\fR\fR
.ad
.RS 14n
.rt
The signal was sent by \fB_lwp_kill\fR(2).
.RE
.sp
.ne 2
.mk
.na
\fB\fBSI_QUEUE\fR\fR
.ad
.RS 14n
.rt
The signal was sent by \fBsigqueue\fR(3C).
.RE
.sp
.ne 2
.mk
.na
\fB\fBSI_TIMER\fR\fR
.ad
.RS 14n
.rt
The signal was generated by the expiration of a timer created by \fBtimer_settime\fR(3C).
.RE
.sp
.ne 2
.mk
.na
\fB\fBSI_ASYNCIO\fR\fR
.ad
.RS 14n
.rt
The signal was generated by the completion of an asynchronous \fBI/O\fR request.
.RE
.sp
.ne 2
.mk
.na
\fB\fBSI_MESGQ\fR\fR
.ad
.RS 14n
.rt
The signal was generated by the arrival of a message on an empty message queue. See \fBmq_notify\fR(3C).
.RE
.sp
.LP
\fBsi_value\fR contains the application specified value, which is passed to the application's signal-catching function at the time of the signal delivery if \fBsi_code\fR is any of \fBSI_QUEUE\fR, \fBSI_TIMER\fR, \fB SI_ASYNCHIO\fR, or \fBSI_MESGQ\fR.
.SS "System Signals"
.sp
.LP
Non-user generated signals can arise for a number of reasons. For all of these cases, \fBsi_code\fR contains a positive value reflecting the reason why the system generated the signal:
.sp
.sp
.TS
tab();
lw(1.24i) lw(1.74i) lw(2.53i)
lw(1.24i) lw(1.74i) lw(2.53i)
.
SignalCodeReason
_
SIGILLILL_ILLOPCillegal opcode
ILL_ILLOPNillegal operand
ILL_ILLADRillegal addressing mode
ILL_ILLTRPillegal trap
ILL_PRVOPCprivileged opcode
ILL_PRVREGprivileged register
ILL_COPROCco-processor error
ILL_BADSTKinternal stack error
_
SIGFPEFPE_INTDIVinteger divide by zero
FPE_INTOVFinteger overflow
FPE_FLTDIVfloating point divide by zero
FPE_FLTOVFfloating point overflow
FPE_FLTUNDfloating point underflow
FPE_FLTRESfloating point inexact result
FPE_FLTINVinvalid floating point operation
FPE_FLTSUBsubscript out of range
_
SIGSEGVSEGV_MAPERRaddress not mapped to object
SEGV_ACCERRinvalid permissions for mapped object
SEGV_ACCADIADI not enabled for mapped object
SEGV_ADIDERRADI mismatch exception disrupting
SEGV_ADIPERRADI mismatch exception precise
_
SEGV_CMIexception in mapped CMI object
SIGBUSBUS_ADRALNinvalid address alignment
BUS_ADRERRnon-existent physical address
BUS_OBJERRobject specific hardware error
BUS_MEM_UEuser process uncorrectable memory error
_
SIGTRAPTRAP_BRKPTprocess breakpoint
TRAP_TRACEprocess trace trap
_
SIGCHLDCLD_EXITEDchild has exited
CLD_KILLEDchild was killed
CLD_DUMPEDchild terminated abnormally
CLD_TRAPPEDtraced child has trapped
CLD_STOPPEDchild has stopped
CLD_CONTINUEDstopped child had continued
_
SIGPOLLPOLL_INdata input available
POLL_OUToutput buffers available
POLL_MSGinput message available
POLL_ERRI/O error
POLL_PRIhigh priority input available
POLL_HUPdevice disconnected
.TE
.sp
.LP
Signals can also be generated from the resource control subsystem. Where these signals do not already possess kernel-level \fBsiginfo\fR codes, the \fBsiginfo\fR \fBsi_code\fR will be filled with \fBSI_RCTL\fR to indicate a kernel-generated signal from an established resource control value.
.sp
.sp
.TS
tab();
cw(1.19i) cw(1.65i) cw(2.65i)
lw(1.19i) lw(1.65i) lw(2.65i)
.
SignalCodeReason
_
SIGXRESSI_RCTLresource-control generated signal
_
SIGHUP
SIGTERM
.TE
.sp
.LP
The uncatchable signals \fBSIGSTOP\fR and \fBSIGKILL\fR have undefined \fBsiginfo\fR codes.
.sp
.LP
Signals sent with a \fBsiginfo\fR code of \fBSI_RCTL\fR contain code-dependent information for kernel-generated signals:
.sp
.sp
.TS
tab();
cw(1.19i) cw(1.65i) cw(2.65i)
lw(1.19i) lw(1.65i) lw(2.65i)
.
Code FieldValue
_
SI_RCTLhr_time si_entityprocess-model entity of control
.TE
.sp
.LP
In addition, the following signal-dependent information is available for kernel-generated signals:
.sp
.sp
.TS
tab();
cw(1.19i) cw(1.67i) cw(2.64i)
lw(1.19i) lw(1.67i) lw(2.64i)
.
SignalFieldValue
_
SIGILLcaddr_t si_addraddress of faulting instruction
_
SIGFPE
_
SIGSEGVcaddr_t si_addraddress of faulting memory reference
SIGBUS
_
SIGCHLDpid_t si_pidchild process ID
int si_statusexit value or signal
_
SIGPOLLlong si_bandT{
band event for \fBPOLL_IN\fR, \fBPOLL_OUT\fR, or \fBPOLL_MSG\fR
T}
.TE
.sp
.LP
Signals sent with a \fBsiginfo\fR code of \fBSEGV_ADIPERR\fR or \fBSEGV_ADIDERR\fR contain signal-dependent information for kernel-generated \fBSIGSEGV\fR signals:
.sp
.sp
.TS
tab();
cw(1.19i) cw(1.67i) cw(2.64i)
lw(1.19i) lw(1.67i) lw(2.64i)
.
CodeFieldValue
_
SEGV_ADIPERRcaddr_t si_addraddress of mismatched memory reference
_
caddr_t si_pcT{
address of instruction that executed mismatched memory reference
T}
_
int si_adiverscurrent ADI version of si_addr
_
SEGV_ADIDERRcaddr_t si_addrT{
instruction address of first store where mismatch was detected
T}
caddr_t si_pc\fB-1\fR
int si_adivers\fB-1\fR
.TE
.sp
.LP
Signals sent with a \fBsiginfo\fR code of \fBSEGV_CMI\fR contain signal-dependent + information for kernel-generated \fBSIGSEGV\fR signals:
.sp
.sp
.TS
tab();
cw(1.19i) cw(1.67i) cw(2.64i)
lw(1.19i) lw(1.67i) lw(2.64i)
.
CodeFieldValue
_
SEGV_CMIint si_trapnoT{
CMI segment id of the mapped CMI + object that contains si_addr
T}
.TE
.SH SEE ALSO
.sp
.LP
\fB_lwp_kill\fR(2), \fBadi_version_max\fR(2), \fBkill\fR(2), \fBsetrctl\fR(2), \fBsigaction\fR(2), \fBsigsend\fR(2), \fBwaitid\fR(2), \fBabort\fR(3C), \fBaio_read\fR(3C), \fBmq_notify\fR(3C), \fBraise\fR(3C), \fBsigqueue\fR(3C), \fBtimer_create\fR(3C), \fBtimer_settime\fR(3C), \fBsignal.h\fR(3HEAD)
.SH NOTES
.sp
.LP
For \fBSIGCHLD\fR signals, if \fBsi_code\fR is equal to \fBCLD_EXITED,\fR then \fBsi_status\fR is equal to the exit value of the process; otherwise, it is equal to the signal that caused the process to change state. For some implementations, the exact value of \fBsi_addr\fR might not be available; in that case, \fBsi_addr\fR is guaranteed to be on the same page as the faulting instruction or memory reference.
.sp
.LP
For \fBSIGSEGV\fR signals with \fBsi_code\fR equal to \fBSEGV_ADIPERR\fR, the value of \fBsi_adivers\fR will be the in-memory version of the mismatched address at the time that the kernel fetches it during the processing of the trap, not the version at the time of the trap. If a thread other than the one that executed the data access and took the trap changes the version between the time of the trap and the kernel access, \fBsi_adivers\fR will contain that new value.
.sp
.LP
For \fBSIGSEGV\fR signals with \fBsi_code\fR equal to \fBSEGV_ADIPERR\fR, if the in-memory version is lost due to a hardware error which cannot be corrected, or if the in-memory version is greater than the value returned by the \fBadi_version_max\fR(2) function, \fBsi_adivers\fR will be set to \fB-1\fR.
.sp
.LP
A \fBSIGSEGV\fR signal with \fBsi_code\fR equal to \fBSEGV_ADIPERR\fR results from an ADI exception that generates a precise trap, while a \fBSIGSEGV\fR signal with \fBsi_code\fR equal to \fBSEGV_ADIDERR\fR results from an ADI exception that generates a disrupting trap. When \fBsi_code\fR is equal to \fBSEGV_ADIDERR\fR, \fBsi_pc\fR is \fB-1\fR because the PC (program counter) where the disrupting trap occurred is not related to the store that caused the trap. \fBsi_adivers\fR is \fB-1\fR because the store address that caused the trap is not provided by the hardware. There is no reliable way for software to determine the address since an unpredictable number of instructions are executed after the store and before the trap is taken due to the nature of a disrupting trap.