1siginfo.h(3HEAD)                    Headers                   siginfo.h(3HEAD)
2
3
4

NAME

6       siginfo.h, siginfo - signal generation information
7

SYNOPSIS

9       #include <siginfo.h>
10
11

DESCRIPTION

13       If  a  process is catching a signal,  it might request information that
14       tells why the system generated that signal.  See   sigaction(2).  If  a
15       process  is  monitoring its children, it might receive information that
16       tells why a child changed state. See  waitid(2). In  either  case,  the
17       system returns the information in a structure of type  siginfo_t, which
18       includes the following information:
19
20         int            si_signo        /* signal number */
21         int            si_errno        /* error number */
22         int            si_code         /* signal code */
23         union sigval   si_value        /* signal value */
24
25
26
27       si_signo  contains  the  system-generated  signal   number.   For   the
28       waitid(2) function,  si_signo is always  SIGCHLD.
29
30
31       If   si_errno  is non-zero, it contains an error number associated with
32       this signal, as defined in  <errno.h>.
33
34
35       si_code contains a code identifying the cause of the signal.
36
37
38       If the value of the  si_code member is  SI_NOINFO,  only  the  si_signo
39       member  of  siginfo_t is meaningful, and the value of all other members
40       is unspecified.
41
42   User Signals
43       If the value of  si_code is less than or equal to 0,  then  the  signal
44       was   generated   by   a  user  process  (see   kill(2),  _lwp_kill(2),
45       sigqueue(3C), sigsend(2), abort(3C), and raise(3C))  and  the   siginfo
46       structure contains the following additional information:
47
48         pid_t        si_pid      /* sending process ID */
49         uid_t        si_uid      /* sending user ID */
50         ctid_t       si_ctid     /* sending contract ID */
51         zoneid_t     si_zoneid   /* sending zone ID */S
52
53
54
55       If the signal was generated by a user process, the following values are
56       defined for si_code:
57
58       SI_USER        The implementation sets si_code to SI_USER if the signal
59                      was sent by kill(2), sigsend(2), raise(3C) or abort(3C).
60
61
62       SI_LWP         The signal was sent by _lwp_kill(2).
63
64
65       SI_QUEUE       The signal was sent by sigqueue(3C).
66
67
68       SI_TIMER       The  signal  was  generated by the expiration of a timer
69                      created by timer_settime(3C).
70
71
72       SI_ASYNCIO     The signal was generated by the completion of  an  asyn‐
73                      chronous  I/O request.
74
75
76       SI_MESGQ       The  signal was generated by the arrival of a message on
77                      an empty message queue. See mq_notify(3C).
78
79
80
81       si_value contains the application specified value, which is  passed  to
82       the  application's  signal-catching  function at the time of the signal
83       delivery if  si_code is any  of  SI_QUEUE,  SI_TIMER,  SI_ASYNCHIO,  or
84       SI_MESGQ.
85
86   System Signals
87       Non-user  generated  signals can arise for a number of reasons. For all
88       of these cases, si_code contains a positive value reflecting the reason
89       why the system generated the signal:
90
91
92
93
94       Signal         Code                 Reason
95       ──────────────────────────────────────────────────────────────────────────
96       SIGILL         ILL_ILLOPC           illegal opcode
97                      ILL_ILLOPN           illegal operand
98                      ILL_ILLADR           illegal addressing mode
99                      ILL_ILLTRP           illegal trap
100                      ILL_PRVOPC           privileged opcode
101                      ILL_PRVREG           privileged register
102                      ILL_COPROC           co-processor error
103                      ILL_BADSTK           internal stack error
104       ──────────────────────────────────────────────────────────────────────────
105       SIGFPE         FPE_INTDIV           integer divide by zero
106                      FPE_INTOVF           integer overflow
107                      FPE_FLTDIV           floating point divide by zero
108                      FPE_FLTOVF           floating point overflow
109                      FPE_FLTUND           floating point underflow
110                      FPE_FLTRES           floating point inexact result
111                      FPE_FLTINV           invalid floating point operation
112                      FPE_FLTSUB           subscript out of range
113       ──────────────────────────────────────────────────────────────────────────
114       SIGSEGV        SEGV_MAPERR          address not mapped to object
115                      SEGV_ACCERR          invalid permissions for mapped object
116       ──────────────────────────────────────────────────────────────────────────
117       SIGBUS         BUS_ADRALN           invalid address alignment
118                      BUS_ADRERR           non-existent physical address
119                      BUS_OBJERR           object specific hardware error
120       ──────────────────────────────────────────────────────────────────────────
121       SIGTRAP        TRAP_BRKPT           process breakpoint
122                      TRAP_TRACE           process trace trap
123       ──────────────────────────────────────────────────────────────────────────
124       SIGCHLD        CLD_EXITED           child has exited
125                      CLD_KILLED           child was killed
126                      CLD_DUMPED           child terminated abnormally
127                      CLD_TRAPPED          traced child has trapped
128                      CLD_STOPPED          child has stopped
129                      CLD_CONTINUED        stopped child had continued
130       ──────────────────────────────────────────────────────────────────────────
131       SIGPOLL        POLL_IN              data input available
132                      POLL_OUT             output buffers available
133                      POLL_MSG             input message available
134
135                      POLL_ERR             I/O error
136                      POLL_PRI             high priority input available
137                      POLL_HUP             device disconnected
138
139
140
141       Signals  can  also  be  generated  from the resource control subsystem.
142       Where these signals do not already possess kernel-level siginfo  codes,
143       the  siginfo  si_code will be filled with SI_RCTL to indicate a kernel-
144       generated signal from an established resource control value.
145
146
147
148
149          Signal            Code                      Reason
150       ────────────────────────────────────────────────────────────────────
151       SIGXRES        SI_RCTL            resource-control generated signal
152       ────────────────────────────────────────────────────────────────────
153       SIGHUP
154       SIGTERM
155
156
157
158       The uncatchable signals SIGSTOP  and  SIGKILL  have  undefined  siginfo
159       codes.
160
161
162       Signals  sent  with  a  siginfo  code of SI_RCTL contain code-dependent
163       information for kernel-generated signals:
164
165
166
167
168          Code              Field                      Value
169       ───────────────────────────────────────────────────────────────────
170       SI_RCTL        hr_time si_entity   process-model entity of control
171
172
173
174       In addition, the following signal-dependent  information  is  available
175       for kernel-generated signals:
176
177
178
179
180          Signal            Field                        Value
181       ────────────────────────────────────────────────────────────────────────
182       SIGILL         caddr_t si_addr     address of faulting instruction
183       ────────────────────────────────────────────────────────────────────────
184       SIGFPE
185       ────────────────────────────────────────────────────────────────────────
186       SIGSEGV        caddr_t si_addr     address of faulting memory reference
187       SIGBUS
188       ────────────────────────────────────────────────────────────────────────
189       SIGCHLD        pid_t si_pid        child process ID
190                      int si_status       exit value or signal
191       ────────────────────────────────────────────────────────────────────────
192       SIGPOLL        long si_band        band event for POLL_IN, POLL_OUT, or
193                                          POLL_MSG
194
195

SEE ALSO

197       _lwp_kill(2), kill(2), setrctl(2), sigaction(2), sigsend(2), waitid(2),
198       abort(3C),  aio_read(3C),  mq_notify(3C),  raise(3C),  signal.h(3HEAD),
199       sigqueue(3C), timer_create(3C), timer_settime(3C)
200

NOTES

202       For  SIGCHLD  signals,  if   si_code  is  equal  to   CLD_EXITED,  then
203       si_status  is  equal to the exit value of the process; otherwise, it is
204       equal to the signal that caused the process to  change state. For  some
205       implementations,  the exact value of si_addr might not be available; in
206       that case, si_addr is guaranteed to be on the same page as the faulting
207       instruction or memory reference.
208
209
210
211SunOS 5.11                        5 Feb 2008                  siginfo.h(3HEAD)
Impressum