~ubuntu-branches/ubuntu/saucy/manpages/saucy

« back to all changes in this revision

Viewing changes to man2/sigaction.2

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2010-10-30 17:16:44 UTC
  • mfrom: (1.1.43 upstream) (2.2.6 sid)
  • Revision ID: james.westby@ubuntu.com-20101030171644-keybyul2o3qsj4r3
Tags: 3.25-1ubuntu1
* Merge from debian unstable (LP: #668739), remaining changes:
  - prctl.2: add notes about PR_SET_PTRACER, specific to Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
.\" 2004-12-09, mtk, added SI_TKILL + other minor changes
40
40
.\" 2005-09-15, mtk, split sigpending(), sigprocmask(), sigsuspend()
41
41
.\"     out of this page into separate pages.
 
42
.\" 2010-06-11 Andi Kleen, add hwpoison signal extensions
 
43
.\" 2010-06-11 mtk, improvements to discussion of various siginfo_t fields.
42
44
.\"
43
 
.TH SIGACTION 2 2009-07-25 "Linux" "Linux Programmer's Manual"
 
45
.TH SIGACTION 2 2010-06-16 "Linux" "Linux Programmer's Manual"
44
46
.SH NAME
45
47
sigaction \- examine and change a signal action
46
48
.SH SYNOPSIS
173
175
This flag is only meaningful when establishing a handler for
174
176
.BR SIGCHLD .
175
177
.TP
176
 
.BR SA_NOCLDWAIT " (Since Linux 2.6)"
 
178
.BR SA_NOCLDWAIT " (since Linux 2.6)"
177
179
.\" To be precise: Linux 2.5.60 -- MTK
178
180
If
179
181
.I signum
269
271
    int      si_timerid;  /* Timer ID; POSIX.1b timers */
270
272
.\" In the kernel: si_tid
271
273
    void    *si_addr;     /* Memory location which caused fault */
272
 
    int      si_band;     /* Band event */
 
274
    long     si_band;     /* Band event (was \fIint\fP in
 
275
                             glibc 2.3.2 and earlier) */
273
276
    int      si_fd;       /* File descriptor */
 
277
    short    si_addr_lsb; /* Least significant bit of address
 
278
                             (since kernel 2.6.32) */
274
279
}
275
280
.fi
276
281
.in
282
287
The rest of the struct may be a union, so that one should only
283
288
read the fields that are meaningful for the given signal:
284
289
.IP * 2
285
 
POSIX.1b signals and
286
 
.B SIGCHLD
 
290
Signals sent with
 
291
.BR kill (2)
 
292
and
 
293
.BR sigqueue (2)
287
294
fill in
288
295
.IR si_pid " and " si_uid .
 
296
In addition, signals sent with
 
297
.BR sigqueue (2)
 
298
fill in
 
299
.IR si_int " and " si_ptr
 
300
with the values specified by the sender the signal;
 
301
see
 
302
.BR sigqueue (2)
 
303
for more details.
289
304
.IP *
290
 
POSIX.1b timers (since Linux 2.6) fill in
 
305
Signals sent by POSIX.1b timers (since Linux 2.6) fill in
291
306
.I si_overrun
292
307
and
293
308
.IR si_timerid .
296
311
field is an internal ID used by the kernel to identify
297
312
the timer; it is not the same as the timer ID returned by
298
313
.BR timer_create (2).
 
314
The
 
315
.I si_overrun
 
316
field is the timer overrun count;
 
317
this is the same information as is obtained by a call to
 
318
.BR timer_getoverrun (2).
 
319
These fields are nonstandard Linux extensions.
 
320
.IP *
 
321
Signals sent for message queue notification (see the description of
 
322
.B SIGEV_SIGNAL
 
323
in
 
324
.BR mq_notify (3))
 
325
fill in
 
326
.IR si_int / si_ptr ,
 
327
with the
 
328
.I sigev_value
 
329
supplied to
 
330
.BR mq_notify (3);
 
331
.IR si_pid ,
 
332
with the process ID of the message sender; and
 
333
.IR si_uid ,
 
334
with the real user ID of the message sender.
299
335
.IP *
300
336
.B SIGCHLD
301
337
fills in
302
 
.IR si_status ", " si_utime " and " si_stime .
 
338
.IR si_pid ", " si_uid ", " si_status ", " si_utime " and " si_stime ,
 
339
providing information about the child.
 
340
The
 
341
.I si_pid
 
342
field is the process ID of the child;
 
343
.I si_uid
 
344
is the child's real user ID.
 
345
The
 
346
.I si_status
 
347
field contains the exit status of the child (if
 
348
.I si_code
 
349
is
 
350
.BR CLD_EXITED ),
 
351
or the signal number that caused the process to change state.
303
352
The
304
353
.I si_utime
305
354
and
306
355
.I si_stime
307
 
fields do not include the times used by waited-for children (unlike
 
356
contain the user and system CPU time used by the child process;
 
357
these fields do not include the times used by waited-for children (unlike
308
358
.BR getrusage (2)
309
359
and
310
360
.BR time (2)).
315
365
a bug meant that these fields reported time in units
316
366
of the (configurable) system jiffy (see
317
367
.BR time (7)).
318
 
\" FIXME .
 
368
.\" FIXME .
319
369
.\" When si_utime and si_stime where originally implemented, the
320
370
.\" measurement unit was HZ, which was the same as clock ticks
321
371
.\" (sysconf(_SC_CLK_TCK)).  In 2.6, HZ became configurable, and
330
380
.\" waited-for children (as is done by getrusage() and times()
331
381
.\" and wait4()).  Solaris 8 does include child times.
332
382
.IP *
333
 
.IR si_int " and " si_ptr
334
 
are specified by the sender of the POSIX.1b signal.
335
 
See
336
 
.BR sigqueue (2)
337
 
for more details.
338
 
.IP *
339
383
.BR SIGILL ,
340
384
.BR SIGFPE ,
341
385
.BR SIGSEGV ,
 
386
.BR SIGBUS ,
342
387
and
343
 
.B SIGBUS
 
388
.BR SIGTRAP
344
389
fill in
345
390
.I si_addr
346
391
with the address of the fault.
347
 
.B SIGPOLL
 
392
.\" FIXME SIGTRAP also sets the following for ptrace_notify() ?
 
393
.\"     info.si_code = exit_code;
 
394
.\"     info.si_pid = task_pid_vnr(current);
 
395
.\"     info.si_uid = current_uid();  /* Real UID */
 
396
On some architectures,
 
397
these signals also fill in the
 
398
.I si_trapno
 
399
filed.
 
400
Some suberrors of
 
401
.BR SIGBUS ,
 
402
in particular
 
403
.B BUS_MCEERR_AO
 
404
and
 
405
.BR BUS_MCEERR_AR ,
 
406
also fill in
 
407
.IR si_addr_lsb .
 
408
This field indicates the least significant bit of the reported address
 
409
and therefore the extent of the corruption.
 
410
For example, if a full page was corrupted,
 
411
.I si_addr_lsb
 
412
contains
 
413
.IR log2(sysconf(_SC_PAGESIZE)) .
 
414
.B BUS_MCERR_*
 
415
and
 
416
.I si_addr_lsb
 
417
are Linux-specific extensions.
 
418
.IP *
 
419
.BR SIGPOLL / SIGIO
348
420
fills in
349
421
.IR si_band " and " si_fd .
 
422
The
 
423
.I si_band
 
424
event is a bit mask containing the same values as are filled in the
 
425
.I revents
 
426
field by
 
427
.BR poll (2).
 
428
The
 
429
.I si_fd
 
430
field indicates the file descriptor for which the I/O event occurred.
350
431
.PP
351
432
.I si_code
352
433
is a value (not a bit mask)
483
564
.TP
484
565
.B BUS_OBJERR
485
566
object-specific hardware error
 
567
.TP
 
568
.BR BUS_MCEERR_AR " (since Linux 2.6.32)"
 
569
Hardware memory error consumed on a machine check; action required.
 
570
.TP
 
571
.BR BUS_MCEERR_AO " (since Linux 2.6.32)"
 
572
Hardware memory error detected in process but not consumed; action optional.
486
573
.RE
487
574
.PP
488
575
The following values can be placed in
497
584
.TP
498
585
.B TRAP_TRACE
499
586
process trace trap
 
587
.TP
 
588
.BR TRAP_BRANCH " (since Linux 2.4)"
 
589
process taken branch trap
 
590
.TP
 
591
.BR TRAP_HWBKPT " (since Linux 2.4)"
 
592
hardware breakpoint/watchpoint
500
593
.RE
501
594
.PP
502
595
The following values can be placed in
542
635
input message available
543
636
.TP
544
637
.B POLL_ERR
545
 
i/o error
 
638
I/O error
546
639
.TP
547
640
.B POLL_PRI
548
641
high priority input available
701
794
.BR core (5),
702
795
.BR signal (7)
703
796
.SH COLOPHON
704
 
This page is part of release 3.24 of the Linux
 
797
This page is part of release 3.25 of the Linux
705
798
.I man-pages
706
799
project.
707
800
A description of the project,