|
NAMEsiginfo —
signal generation information
SYNOPSIS#include <signal.h>
DESCRIPTIONA process may request signal information when it is catching a signal. The information specifies why the system generated that signal. To request signal information in a signal handler, the user can setSA_SIGINFO in sa_flags before
sigaction(2)
is called, otherwise the user can use
sigwaitinfo(2)
and
sigtimedwait(2)
to get signal information. In either case, the system returns the information
in a structure of type siginfo_t, which includes the
following information:
The si_signo member contains the signal number. The si_errno member contains an error number
defined in the file
The si_code member contains a code which describes the cause of the signal. The macros specified in the Code column of the following table are defined for use as values of si_code that are signal-specific or non-signal-specific reasons why the signal was generated:
For synchronous signals, si_addr is
generally set to the address of the faulting instruction. However,
synchronous signals raised by a faulting memory access such as
Sychronous signals set si_trapno to a machine-dependent trap number. In addition, the following signal-specific information is available:
Finally, the following code-specific information is available:
NOTESCurrently, the kernel never generates theSIGPOLL
signal. SIGCHLD signal is queued when a process
changed its status or exited. POSIX Realtime Extensions like aio, timer, and
message queue also queue signals. Signals with code
SI_USER , SI_KERNEL or
SI_LWP are only queued if there are sufficient
resources; otherwise, SI_NOINFO results. For some
hardware architectures, the exact value of si_addr might
not be available.
SEE ALSOaio_read(2), kill(2), mq_notify(2), sigaction(2), sigqueue(2), sigwaitinfo(2), timer_create(2), timer_settime(2), waitpid(2), pthread_kill(3)STANDARDSThe siginfo_t type conforms to IEEE Std 1003.1-2004 (“POSIX.1”).HISTORYFull support for POSIX signal information first appeared in FreeBSD 7.0. The codesSI_USER
and SI_KERNEL can be generated as of
FreeBSD 8.1. The code SI_LWP
can be generated as of FreeBSD 9.0.
AUTHORSThis manual page was written by David Xu <davidxu@FreeBSD.org>.
Visit the GSP FreeBSD Man Page Interface. |