diff --git a/man2/sigaction.2 b/man2/sigaction.2 index 92a9228b2..a2f582b99 100644 --- a/man2/sigaction.2 +++ b/man2/sigaction.2 @@ -263,111 +263,207 @@ fills in .IR si_band " and " si_fd . .PP .I si_code -indicates why this signal was sent. -It is a value, not a bitmask. -The values which are possible for any signal are listed in this table: -.TS -tab(:) allbox; -c s -l l. -\fIsi_code\fR -Value:Signal origin -SI_USER:kill(2) or raise(3) -SI_KERNEL:The kernel -SI_QUEUE:sigqueue(2) -SI_TIMER:POSIX timer expired -SI_MESGQ:POSIX message queue state changed (since Linux 2.6.6) -SI_ASYNCIO:AIO completed -SI_SIGIO:queued SIGIO -SI_TKILL:tkill(2) or tgkill(2) (since Linux 2.4.19) +is a value (not a bit mask) +indicating why this signal was sent. +The following list shows the values can be placed in +.I si_code +for any signal, along with reason that the signal was generated. +.RS 4 +.TP 15 +.B SI_USER +.BR kill (2) +or +.BR raise (3) +.TP +.B SI_KERNEL +Sent by the kernel. +.TP +.B SI_QUEUE +.BR sigqueue (2) +.TP +.B SI_TIMER +POSIX timer expired +.TP +.B SI_MESGQ +POSIX message queue state changed (since Linux 2.6.6); see +.BR mq_notify (3) +.TP +.B SI_ASYNCIO +AIO completed +.TP +.B SI_SIGIO +queued SIGIO +.TP +.B SI_TKILL +.BR tkill (2) +or +.BR tgkill (2) +(since Linux 2.4.19) .\" SI_DETHREAD is defined in 2.6.9 sources, but isn't implemented .\" It appears to have been an idea that was tried during 2.5.6 .\" through to 2.5.24 and then was backed out. -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGILL -ILL_ILLOPC:illegal opcode -ILL_ILLOPN:illegal operand -ILL_ILLADR:illegal addressing mode -ILL_ILLTRP:illegal trap -ILL_PRVOPC:privileged opcode -ILL_PRVREG:privileged register -ILL_COPROC:coprocessor error -ILL_BADSTK:internal stack error -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGFPE -FPE_INTDIV:integer divide by zero -FPE_INTOVF:integer overflow -FPE_FLTDIV:floating point divide by zero -FPE_FLTOVF:floating point overflow -FPE_FLTUND:floating point underflow -FPE_FLTRES:floating point inexact result -FPE_FLTINV:floating point invalid operation -FPE_FLTSUB:subscript out of range -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGSEGV -SEGV_MAPERR:address not mapped to object -SEGV_ACCERR:invalid permissions for mapped object -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGBUS -BUS_ADRALN:invalid address alignment -BUS_ADRERR:non-existent physical address -BUS_OBJERR:object specific hardware error -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGTRAP -TRAP_BRKPT:process breakpoint -TRAP_TRACE:process trace trap -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGCHLD -CLD_EXITED:child has exited -CLD_KILLED:child was killed -CLD_DUMPED:child terminated abnormally -CLD_TRAPPED:traced child has trapped -CLD_STOPPED:child has stopped -CLD_CONTINUED:stopped child has continued (since Linux 2.6.9) -.TE - -.TS -tab(:) allbox; -c s -l l. -SIGPOLL -POLL_IN:data input available -POLL_OUT:output buffers available -POLL_MSG:input message available -POLL_ERR:i/o error -POLL_PRI:high priority input available -POLL_HUP:device disconnected -.TE +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGILL +signal: +.RS 4 +.TP 15 +.B ILL_ILLOPC +illegal opcode +.TP +.B ILL_ILLOPN +illegal operand +.TP +.B ILL_ILLADR +illegal addressing mode +.TP +.B ILL_ILLTRP +illegal trap +.TP +.B ILL_PRVOPC +privileged opcode +.TP +.B ILL_PRVREG +privileged register +.TP +.B ILL_COPROC +coprocessor error +.TP +.B ILL_BADSTK +internal stack error +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGFPE +signal: +.RS 4 +.TP 15 +.B FPE_INTDIV +integer divide by zero +.TP +.B FPE_INTOVF +integer overflow +.TP +.B FPE_FLTDIV +floating point divide by zero +.TP +.B FPE_FLTOVF +floating point overflow +.TP +.B FPE_FLTUND +floating point underflow +.TP +.B FPE_FLTRES +floating point inexact result +.TP +.B FPE_FLTINV +floating point invalid operation +.TP +.B FPE_FLTSUB +subscript out of range +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGSEGV +signal: +.RS 4 +.TP 15 +.B SEGV_MAPERR +address not mapped to object +.TP +.B SEGV_ACCERR +invalid permissions for mapped object +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGBUS +signal: +.RS 4 +.TP 15 +.B BUS_ADRALN +invalid address alignment +.TP +.B BUS_ADRERR +non-existent physical address +.TP +.B BUS_OBJERR +object specific hardware error +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGTRAP +signal: +.RS 4 +.TP 15 +.B TRAP_BRKPT +process breakpoint +.TP +.B TRAP_TRACE +process trace trap +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGILL +signal: +.RS 4 +.TP 15 +.B CLD_EXITED +child has exited +.TP +.B CLD_KILLED +child was killed +.TP +.B CLD_DUMPED +child terminated abnormally +.TP +.B CLD_TRAPPED +traced child has trapped +.TP +.B CLD_STOPPED +child has stopped +.TP +.B CLD_CONTINUED +stopped child has continued (since Linux 2.6.9) +.RE +.PP +The following values can be place in +.I si_code +for a +.B SIGPOLL +signal: +.RS 4 +.TP 15 +.B POLL_IN +data input available +.TP +.B POLL_OUT +output buffers available +.TP +.B POLL_MSG +input message available +.TP +.B POLL_ERR +i/o error +.TP +.B POLL_PRI +high priority input available +.TP +.B POLL_HUP +device disconnected +.RE .SH "RETURN VALUE" .BR sigaction () returns 0 on success and \-1 on error.