+-------------------------------------------------------------------+
| si_code |
+-----------+-------------------------------------------------------+
|Value | Signal origin |
+-----------+-------------------------------------------------------+
|SI_USER | kill(), sigsend(), or raise() |
+-----------+-------------------------------------------------------+
|SI_KERNEL | The kernel |
+-----------+-------------------------------------------------------+
|SI_QUEUE | sigqueue() |
+-----------+-------------------------------------------------------+
|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() or tgkill() (since Linux 2.4.19) |
+-----------+-------------------------------------------------------+
+-------------------------------------+
| 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 |
+-----------+-------------------------+
+----------------------------------------------+
| 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 |
+-----------+----------------------------------+
+----------------------------------------------------+
| SIGSEGV |
+------------+---------------------------------------+
|SEGV_MAPERR | address not mapped to object |
+------------+---------------------------------------+
|SEGV_ACCERR | invalid permissions for mapped object |
+------------+---------------------------------------+
+--------------------------------------------+
| SIGBUS |
+-----------+--------------------------------+
|BUS_ADRALN | invalid address alignment |
+-----------+--------------------------------+
|BUS_ADRERR | non-existent physical address |
+-----------+--------------------------------+
|BUS_OBJERR | object specific hardware error |
+-----------+--------------------------------+
+--------------------------------+
| SIGTRAP |
+-----------+--------------------+
|TRAP_BRKPT | process breakpoint |
+-----------+--------------------+
|TRAP_TRACE | process trace trap |
+-----------+--------------------+
+----------------------------------------------------------------+
| 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) |
+--------------+-------------------------------------------------+
+-----------------------------------------+
| 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 |
+---------+-------------------------------+
返回说明:
成功执行时,返回0。失败返回-1,errno被设为以下的某个值
EFAULT:act或oldact指向的内存区并非有效的进程地址空间
EINVAL:指定无效的信号,或者尝试改变SIGKILL 或 SIGSTOP信号的处理方式