siginfo(5) siginfo(5)
NAME
siginfo - signal generation information
SYNOPSIS
#include <siginfo.h>
DESCRIPTION
If a process is catching a signal, it may request information that tells
why the system generated that signal (see sigaction(2)). If a process is
monitoring its children, it may receive information that tells why a
child changed state (see waitid(2)). In either case, the system returns
the information in a structure of type siginfot, which includes the
following information:
int si_signo /* signal number */
int si_errno /* error number */
int si_code /* signal code */
sisigno contains the system-generated signal number. (For the waitid(2)
function, sisigno is always SIGCHLD.)
If sierrno is non-zero, it contains an error number associated with this
signal, as defined in errno.h.
sicode contains a code identifying the cause of the signal. If the
value of sicode is less than or equal to 0, then the signal was
generated either by a user process or on behalf of a user initiated
service. In this case sicode defines which service initiated the
request and determines what (if any) additional information is included
in the siginfo structure. The following are the possible user initiated
sicode values:
SIUSER The signal was generated via kill(2) or sigsend(2). The
siginfo structure contains the following additional
information:
pid_t si_pid /* sending process ID */
uid_t si_uid /* sending user ID */
SIQUEUE The signal was generated via sigqueue(3). The siginfo
structure contains the following additional information:
pid_t si_pid /* sending process ID */
uid_t si_uid /* sending user ID */
union sigval si_value; /* value sent via sigqueue */
Otherwise, sicode contains a signal-specific reason why the signal was
generated, as follows:
Page 1
siginfo(5) siginfo(5)
Signal Code Reason
_______________________________________________________________
SIGILL ILLILLOPC illegal opcode
ILLILLOPN illegal operand
ILLILLADR illegal addressing mode
ILLILLTRP illegal trap
ILLPRVOPC privileged opcode
ILLPRVREG privileged register
ILLCOPROC coprocessor error
ILLBADSTK internal stack error
_______________________________________________________________
SIGFPE FPEINTDIV integer divide by zero
FPEINTOVF integer overflow
FPEFLTDIV floating point divide by zero
FPEFLTOVF floating point overflow
FPEFLTUND floating point underflow
FPEFLTRES floating point inexact result
FPEFLTINV invalid floating point operation
FPEFLTSUB subscript out of range
SIGSEGV SEGVMAPERR address not mapped to object
SEGVACCERR invalid permissions for mapped object
_______________________________________________________________
SIGBUS BUSADRALN invalid address alignment
BUSADRERR non-existent physical address
BUSOBJERR object specific hardware error
_______________________________________________________________
SIGTRAP TRAPBRKPT process breakpoint
TRAPTRACE process trace trap
_______________________________________________________________
SIGCHLD CLDEXITED child has exited
CLDKILLED child was killed
CLDDUMPED child terminated abnormally
CLDTRAPPED traced child has trapped
CLDSTOPPED child has stopped
CLDCONTINUED stopped child had continued
_______________________________________________________________
SIGPOLL POLLIN data input available
POLLOUT output buffers available
POLLMSG input message available
POLLERR I/O error
POLLPRI high priority input available
POLLHUP device disconnected
In addition, the following signal-dependent information is available for
kernel-generated signals:
Signal Field Value
Page 2
siginfo(5) siginfo(5)
_________________________________________________________________
SIGILL caddrt siaddr address of faulting instruction
SIGFPE
________________________________________________________________
SIGSEGV caddrt siaddr address of faulting memory reference
SIGBUS
________________________________________________________________
SIGCHLD pidt sipid child process ID
int sistatus exit value or signal
________________________________________________________________
SIGPOLL long siband band event for POLLIN, POLLOUT, or
POLLMSG
SEE ALSO
kill(2), sigaction(2), sigqueue(2), sigsend(2), waitid(2), signal(5)
NOTES
For SIGCHLD signals, if sicode is equal to CLDEXITED, then sistatus 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 siaddr may not be available; in that
case, siaddr is guaranteed to be on the same page as the faulting
instruction or memory reference.
Page 3