2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" Copyright 1989 AT&T
4 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
5 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
6 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
7 .TH SIGINFO.H 3HEAD "Feb 5, 2008"
9 siginfo.h, siginfo \- signal generation information
19 If a process is catching a signal, it might request information that tells why
20 the system generated that signal. See \fBsigaction\fR(2). If a process is
21 monitoring its children, it might receive information that tells why a child
22 changed state. See \fBwaitid\fR(2). In either case, the system returns the
23 information in a structure of type \fBsiginfo_t\fR, which includes the
24 following information:
28 int si_signo /* signal number */
29 int si_errno /* error number */
30 int si_code /* signal code */
31 union sigval si_value /* signal value */
37 \fBsi_signo\fR contains the system-generated signal number. For the
38 \fBwaitid\fR(2) function, \fBsi_signo\fR is always \fBSIGCHLD\fR.
41 If \fBsi_errno\fR is non-zero, it contains an error number associated with
42 this signal, as defined in \fB<errno.h>\fR\&.
45 \fBsi_code\fR contains a code identifying the cause of the signal.
48 If the value of the \fBsi_code\fR member is \fBSI_NOINFO,\fR only the
49 \fBsi_signo\fR member of \fBsiginfo_t\fR is meaningful, and the value of all
50 other members is unspecified.
54 If the value of \fBsi_code\fR is less than or equal to 0, then the signal was
55 generated by a user process (see \fBkill\fR(2), \fB_lwp_kill\fR(2),
56 \fBsigqueue\fR(3C), \fBsigsend\fR(2), \fBabort\fR(3C), and \fBraise\fR(3C)) and
57 the \fBsiginfo\fR structure contains the following additional information:
61 pid_t si_pid /* sending process ID */
62 uid_t si_uid /* sending user ID */
63 ctid_t si_ctid /* sending contract ID */
64 zoneid_t si_zoneid /* sending zone ID */S
70 If the signal was generated by a user process, the following values are defined
78 The implementation sets \fBsi_code\fR to \fBSI_USER\fR if the signal was sent
79 by \fBkill\fR(2), \fBsigsend\fR(2), \fBraise\fR(3C) or \fBabort\fR(3C).
88 The signal was sent by \fB_lwp_kill\fR(2).
97 The signal was sent by \fBsigqueue\fR(3C).
103 \fB\fBSI_TIMER\fR \fR
106 The signal was generated by the expiration of a timer created by
107 \fBtimer_settime\fR(3C).
113 \fB\fBSI_ASYNCIO\fR \fR
116 The signal was generated by the completion of an asynchronous \fBI/O\fR
123 \fB\fBSI_MESGQ\fR \fR
126 The signal was generated by the arrival of a message on an empty message queue.
127 See \fBmq_notify\fR(3C).
132 \fBsi_value\fR contains the application specified value, which is passed to the
133 application's signal-catching function at the time of the signal delivery if
134 \fBsi_code\fR is any of \fBSI_QUEUE\fR, \fBSI_TIMER\fR, \fBSI_ASYNCHIO\fR, or
139 Non-user generated signals can arise for a number of reasons. For all of these
140 cases, \fBsi_code\fR contains a positive value reflecting the reason why the
141 system generated the signal:
150 SIGILL ILL_ILLOPC illegal opcode
151 ILL_ILLOPN illegal operand
152 ILL_ILLADR illegal addressing mode
153 ILL_ILLTRP illegal trap
154 ILL_PRVOPC privileged opcode
155 ILL_PRVREG privileged register
156 ILL_COPROC co-processor error
157 ILL_BADSTK internal stack error
159 SIGFPE FPE_INTDIV integer divide by zero
160 FPE_INTOVF integer overflow
161 FPE_FLTDIV floating point divide by zero
162 FPE_FLTOVF floating point overflow
163 FPE_FLTUND floating point underflow
164 FPE_FLTRES floating point inexact result
165 FPE_FLTINV invalid floating point operation
166 FPE_FLTSUB subscript out of range
168 SIGSEGV SEGV_MAPERR address not mapped to object
169 SEGV_ACCERR invalid permissions for mapped object
171 SIGBUS BUS_ADRALN invalid address alignment
172 BUS_ADRERR non-existent physical address
173 BUS_OBJERR object specific hardware error
175 SIGTRAP TRAP_BRKPT process breakpoint
176 TRAP_TRACE process trace trap
178 SIGCHLD CLD_EXITED child has exited
179 CLD_KILLED child was killed
180 CLD_DUMPED child terminated abnormally
181 CLD_TRAPPED traced child has trapped
182 CLD_STOPPED child has stopped
183 CLD_CONTINUED stopped child had continued
185 SIGPOLL POLL_IN data input available
186 POLL_OUT output buffers available
187 POLL_MSG input message available
189 POLL_PRI high priority input available
190 POLL_HUP device disconnected
195 Signals can also be generated from the resource control subsystem. Where these
196 signals do not already possess kernel-level \fBsiginfo\fR codes, the
197 \fBsiginfo\fR \fBsi_code\fR will be filled with \fBSI_RCTL\fR to indicate a
198 kernel-generated signal from an established resource control value.
207 SIGXRES SI_RCTL resource-control generated signal
215 The uncatchable signals \fBSIGSTOP\fR and \fBSIGKILL\fR have undefined
219 Signals sent with a \fBsiginfo\fR code of \fBSI_RCTL\fR contain code-dependent
220 information for kernel-generated signals:
229 SI_RCTL hr_time si_entity process-model entity of control
234 In addition, the following signal-dependent information is available for
235 kernel-generated signals:
244 SIGILL caddr_t si_addr address of faulting instruction
248 SIGSEGV caddr_t si_addr address of faulting memory reference
251 SIGCHLD pid_t si_pid child process ID
252 int si_status exit value or signal
254 SIGPOLL long si_band T{
255 band event for \fBPOLL_IN\fR, \fBPOLL_OUT\fR, or \fBPOLL_MSG\fR
262 \fB_lwp_kill\fR(2), \fBkill\fR(2), \fBsetrctl\fR(2), \fBsigaction\fR(2),
263 \fBsigsend\fR(2), \fBwaitid\fR(2), \fBabort\fR(3C), \fBaio_read\fR(3C),
264 \fBmq_notify\fR(3C), \fBraise\fR(3C), \fBsignal.h\fR(3HEAD),
265 \fBsigqueue\fR(3C), \fBtimer_create\fR(3C), \fBtimer_settime\fR(3C)
269 For \fBSIGCHLD\fR signals, if \fBsi_code\fR is equal to \fBCLD_EXITED,\fR
270 then \fBsi_status\fR is equal to the exit value of the process; otherwise, it
271 is equal to the signal that caused the process to change state. For some
272 implementations, the exact value of \fBsi_addr\fR might not be available; in
273 that case, \fBsi_addr\fR is guaranteed to be on the same page as the faulting
274 instruction or memory reference.