Headers siginfo.h(3HEAD)
NAME
siginfo.h, siginfo - signal generation information
SYNOPSIS
#include
DESCRIPTION
If a process is catching a signal, it might request infor-
mation that tells why the system generated that signal. See sigaction(2). If a process is monitoring its children, it might receive information that tells why a child changed state. See waitid(2). In either case, the system returnsthe information in a structure of type siginfo_t, which
includes the following information:int si_signo /* signal number */
int si_errno /* error number */
int si_code /* signal code */
union sigval si_value /* signal value */
si_signo contains the system-generated signal number. For
the waitid(2) function, si_signo is always SIGCHLD.
If si_errno is non-zero, it contains an error number asso-
ciated with this signal, as defined in. si_code contains a code identifying the cause of the signal.
If the value of the si_code member is SI_NOINFO, only the
si_signo member of siginfo_t is meaningful, and the value
of all other members is unspecified. User SignalsIf the value of si_code is less than or equal to 0, then
the signal was generated by a user process (see kill(2),_lwp_kill(2), sigqueue(3C), sigsend(2), abort(3C), and
raise(3C)) and the siginfo structure contains the following
additional information: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
SunOS 5.11 Last change: 5 Feb 2008 1
Headers siginfo.h(3HEAD)
If the signal was generated by a user process, the followingvalues are defined for si_code:
SI_USER The implementation sets si_code to SI_USER if
the signal was sent by kill(2), sigsend(2), raise(3C) or abort(3C).SI_LWP The signal was sent by _lwp_kill(2).
SI_QUEUE The signal was sent by sigqueue(3C).
SI_TIMER The signal was generated by the expiration of
a timer created by timer_settime(3C).
SI_ASYNCIO The signal was generated by the completion of
an asynchronous I/O request.
SI_MESGQ The signal was generated by the arrival of a
message on an empty message queue. Seemq_notify(3C).
si_value contains the application specified value, which is
passed to the application's signal-catching function at the
time of the signal delivery if si_code is any of SI_QUEUE,
SI_TIMER, SI_ASYNCHIO, or SI_MESGQ.
System SignalsNon-user generated signals can arise for a number of rea-
sons. For all of these cases, si_code contains a positive
value reflecting the reason why the system generated the signal: Signal Code Reason_________________________________________________________________________
SIGILL ILL_ILLOPC illegal opcode
ILL_ILLOPN illegal operand
ILL_ILLADR illegal addressing mode
ILL_ILLTRP illegal trap
ILL_PRVOPC privileged opcode
ILL_PRVREG privileged register
ILL_COPROC co-processor error
ILL_BADSTK internal stack error
_________________________________________________________________________
SunOS 5.11 Last change: 5 Feb 2008 2
Headers siginfo.h(3HEAD)
SIGFPE FPE_INTDIV integer divide by zero
FPE_INTOVF integer overflow
FPE_FLTDIV floating point divide by zero
FPE_FLTOVF floating point overflow
FPE_FLTUND floating point underflow
FPE_FLTRES floating point inexact result
FPE_FLTINV invalid floating point operation
FPE_FLTSUB subscript out of range
_________________________________________________________________________
SIGSEGV SEGV_MAPERR address not mapped to object
SEGV_ACCERR invalid permissions for mapped object
_________________________________________________________________________
SIGBUS BUS_ADRALN invalid address alignment
BUS_ADRERR non-existent physical address
BUS_OBJERR object specific hardware error
_________________________________________________________________________
SIGTRAP TRAP_BRKPT process breakpoint
TRAP_TRACE process trace trap
_________________________________________________________________________
SIGCHLD CLD_EXITED child has exited
CLD_KILLED child was killed
CLD_DUMPED child terminated abnormally
CLD_TRAPPED traced child has trapped
CLD_STOPPED child has stopped
CLD_CONTINUED stopped child had continued
_________________________________________________________________________
SIGPOLL POLL_IN data input available
POLL_OUT output buffers available
POLL_MSG input message available
POLL_ERR I/O error
POLL_PRI high priority input available
POLL_HUP device disconnected
Signals can also be generated from the resource control sub-
system. Where these signals do not already possess kernel-
level siginfo codes, the siginfo si_code will be filled with
SI_RCTL to indicate a kernel-generated signal from an esta-
blished resource control value. Signal Code Reason___________________________________________________________________
SIGXRES SI_RCTL resource-control generated signal
___________________________________________________________________
SIGHUP SIGTERMSunOS 5.11 Last change: 5 Feb 2008 3
Headers siginfo.h(3HEAD)
The uncatchable signals SIGSTOP and SIGKILL have undefinedsiginfo codes.
Signals sent with a siginfo code of SI_RCTL contain code-
dependent information for kernel-generated signals:
Code Field Value__________________________________________________________________
SI_RCTL hr_time si_entity process-model entity of control
In addition, the following signal-dependent information is
available for kernel-generated signals:
Signal Field Value_______________________________________________________________________
SIGILL caddr_t si_addr address of faulting instruction
_______________________________________________________________________
SIGFPE_______________________________________________________________________
SIGSEGV caddr_t si_addr address of faulting memory reference
SIGBUS_______________________________________________________________________
SIGCHLD pid_t si_pid child process ID
int si_status exit value or signal
_______________________________________________________________________
SIGPOLL long si_band band event for POLL_IN, POLL_OUT, or
POLL_MSG
SEE ALSO
_lwp_kill(2), kill(2), setrctl(2), sigaction(2), sigsend(2),
waitid(2), abort(3C), aio_read(3C), mq_notify(3C),
raise(3C), signal.h(3HEAD), sigqueue(3C), timer_create(3C),
timer_settime(3C)
NOTESFor SIGCHLD signals, if si_code is equal to CLD_EXITED,
then si_status 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 valueof si_addr might not be available; in that case, si_addr is
guaranteed to be on the same page as the faulting instruc-
tion or memory reference.SunOS 5.11 Last change: 5 Feb 2008 4