Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
.\"	$NetBSD: siginfo.2,v 1.24 2020/06/08 17:19:44 sevan Exp $
.\"
.\" Copyright (c) 2003 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This code is derived from software contributed to The NetBSD Foundation
.\" by Christos Zoulas.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd May 25, 2019
.Dt SIGINFO 2
.Os
.Sh NAME
.Nm siginfo
.Nd signal information
.Sh SYNOPSIS
.In signal.h
.Sh DESCRIPTION
.Nm
is a structure type which contains information about a signal delivered
to a process.
.Pp
.Nm
includes the following members:
.Bd -literal -offset indent
int si_signo;
int si_errno;
int si_code;
.Ed
.Pp
.Fa si_signo
contains the signal number generated by the system.
.Pp
If
.Fa si_errno
is non-zero, then it contains a system specific error number associated
with this signal.
This number is defined in
.Xr errno 2 .
.Pp
If
.Fa si_code
is less than or equal to zero, the signal was generated by a user process
or a user requested service:
.Bl -tag -width SI_ASYNCIO
.It SI_USER
The signal was generated via
.Xr kill 2 .
The
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
pid_t si_pid;
uid_t si_uid;
.Ed
.Pp
The
.Fa si_pid
field contains the pid of the sending process and the
.Fa si_uid
field contains the user id of the sending process.
.It SI_QUEUE
The signal was generated via
.Xr sigqueue 2 .
The
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
pid_t si_pid;
uid_t si_uid;
sigval_t si_value;
.Ed
.Pp
The
.Fa si_pid
field contains the pid of the sending process and the
.Fa si_uid
field contains the user id of the sending process.
Finally, the
.Fa si_value
field contains the value sent via
.Xr sigqueue 2 .
.It SI_TIMER
The signal was generated because a timer set by
.Xr timer_settime 2
has expired.
The
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
sigval_t si_value;
.Ed
.Pp
The
.Fa si_value
field contains the value set via
.Xr timer_create 2 .
.It SI_ASYNCIO
The signal was generated by completion of an asynchronous I/O operation.
The
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
int si_fd;
long si_band;
.Ed
.Pp
The
.Fa si_fd
argument contains the file descriptor number on which the operation was
completed and the
.Fa si_band
field contains the side and priority of the operation.
If the operation was a normal read,
.Fa si_band
will contain
.Dv POLLIN | POLLRDNORM ;
on an out-of-band read it will contain
.Dv POLLPRI | POLLRDBAND ;
on a normal write it will contain
.Dv POLLOUT | POLLWRNORM ;
on an out-of-band write it will contain
.Dv POLLPRI | POLLWRBAND .
.It SI_MESGQ
The signal was generated because of the arrival of a message on an empty
message queue.
See
.Xr mq_notify 3 .
.It SI_LWP
The signal was generated via
.Xr _lwp_kill 2 .
The
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
pid_t si_pid;
uid_t si_uid;
.Ed
.Pp
The
.Fa si_pid
field contains the pid of the sending process and the
.Fa si_uid
field contains the user id of the sending process.
.It SI_NOINFO
The signal was generated without specific info available.
.El
.Pp
If
.Fa si_code
is positive, then it contains a signal specific reason
why the signal was generated:
.Bl -tag -width SIGCHLD
.It SIGILL
.Bl -tag -width ILL_ILLOPC
.It ILL_BADSTK
Internal stack error
.It ILL_COPROC
Coprocessor error
.It ILL_ILLADR
Illegal addressing mode
.It ILL_ILLOPC
Illegal opcode
.It ILL_ILLOPN
Illegal operand
.It ILL_ILLTRP
Illegal trap
.It ILL_PRVOPC
Privileged opcode
.It ILL_PRVREG
Privileged register
.El
.It SIGFPE
.Bl -tag -width FPE_INTDIV
.It FPE_FLTDIV
Floating-point divide by zero
.It FPE_FLTINV
Invalid floating-point operation
.It FPE_FLTOVF
Floating-point overflow
.It FPE_FLTRES
Floating-point inexact result
.It FPE_FLTUND
Floating-point underflow
.It FPE_FLTSUB
Subscript out of range
.It FPE_INTDIV
Integer divide by zero
.It FPE_INTOVF
Integer overflow
.El
.It SIGSEGV
.Bl -tag -width SEGV_MAPERR
.It SEGV_ACCERR
Invalid permissions for mapped object
.It SEGV_MAPERR
Address not mapped to object
.El
.It SIGBUS
.Bl -tag -width BUS_ADRALN
.It BUS_ADRALN
Invalid address alignment
.It BUS_ADRERR
Nonexistent physical address
.It BUS_OBJERR
Object-specific hardware error
.El
.It SIGTRAP
.Bl -tag -width TRAP_BRKPT
.It TRAP_BRKPT
Process breakpoint
.It TRAP_CHLD
Process child trap
.It TRAP_DBREG
Process hardware debug register trap
.It TRAP_EXEC
Process exec trap
.It TRAP_LWP
Process LWP trap
.It TRAP_SCE
Process syscall entry trap
.It TRAP_SCX
Process syscall exit trap
.It TRAP_TRACE
Process trace trap
.El
.It SIGCHLD
.Bl -tag -width CLD_CONTINUED
.It CLD_CONTINUED
Stopped child has continued
.It CLD_DUMPED
Child has terminated abnormally and created a core file
.It CLD_EXITED
Child has exited
.It CLD_KILLED
Child has terminated abnormally but did not create a core file
.It CLD_STOPPED
Child has stopped
.It CLD_TRAPPED
Traced child has trapped
.El
.It SIGIO
.Bl -tag -width POLL_OUT
.It POLL_ERR
I/O error
.It POLL_HUP
Device disconnected
.It POLL_IN
Data input available
.It POLL_MSG
Input message available
.It POLL_OUT
Output buffers available
.It POLL_PRI
High priority input available
.El
.El
.Pp
For
.Dv SIGILL ,
.Dv SIGFPE ,
.Dv SIGBUS
and
.Dv SIGSEGV
the
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
void *si_addr;
int si_trap;
.Ed
.Pp
.Fa si_addr
contains the address of the faulting instruction or data and
.Fa si_trap
contains a hardware specific reason.
.Pp
For
.Dv SIGTRAP
and
.Dv TRAP_BRKPT ,
.Dv TRAP_TRACE
or
.Dv TRAP_DBREG
the
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
void *si_addr;
int si_trap;
.Ed
.Pp
.Fa si_addr
contains the address of the faulting data and
.Fa si_trap
contains a hardware specific reason.
.Pp
For
.Dv SIGTRAP
and
.Dv TRAP_SCE
or
.Dv TRAP_SCX
the
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
int si_sysnum;
int si_retval[2];
int si_error;
uint64_t si_args[8];
.Ed
.Pp
.Fa si_sysnum
contains the syscall number,
.Fa si_retval
contains the syscall return value (meaningful for
.Dv TRAP_SCX
only),
.Fa si_error
contains the syscall error value (meaningful for
.Dv TRAP_SCX
only) and
.Fa si_args[8]
contains the syscall arguments,
.Pp
For
.Dv SIGIO
the
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
int si_fd;
long si_band;
.Ed
.Pp
The
.Fa si_fd
argument contains the file descriptor number on which the operation was
completed and the
.Fa si_band
field contains the side and priority of the operation as described above.
.Pp
Finally, for
.Dv SIGCHLD
the
.Nm
structure contains the following additional members:
.Bd -literal -offset indent
pid_t si_pid;
uid_t si_uid;
int si_status;
clock_t	si_utime;
clock_t	si_stime;
.Ed
.Pp
The
.Fa si_pid
field contains the pid of the process who's status changed, the
.Fa si_uid
field contains the user id of the that process, the
.Fa si_status
field contains either the exit code of the process (for
.Dv CLD_EXITED ) ,
or the signal number received by the process.
.Xr waitid 2 ,
.Xr waitpid 2 ,
and the
.Fa si_utime
and
.Fa si_stime
fields contain the user and system process accounting time.
.Sh STANDARDS
The
.Nm
type conforms to
.St -xsh5 .
.Pp
Signals specifying
.Dv SI_LWP
or
.Dv SI_NOINFO
are
.Nx
extensions.
.Pp
The
.Dv TRAP_CHLD ,
.Dv TRAP_DBREG ,
.Dv TRAP_EXEC ,
.Dv TRAP_LWP ,
.Dv TRAP_SCE
and
.Dv TRAP_SCX
signal specific reasons of
.Dv SIGTRAP
are
.Nx
extensions.
.Sh HISTORY
The
.Nm
functionality first appeared in
.At V.4 .
.Pp
.Dv TRAP_CHLD ,
.Dv TRAP_DBREG ,
.Dv TRAP_EXEC ,
.Dv TRAP_LWP ,
.Dv TRAP_SCE
and
.Dv TRAP_SCX
first appeared
in
.Nx 8 .
.Pp
The additional parameters with syscall information in
.Dv TRAP_SCE
and
.Dv TRAP_SCX
first appeared in
.Nx 9 .