⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 signal.h.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<dt>SA_SIGINFO<dd>Causes extra information to be passed to signal handlers at the timeof receipt of a signal.<dt>SA_NOCLDWAIT<dd>Causes implementations not to create zombie processes on child death.<dt>SA_NODEFER<dd>Causes signal not to be automatically blocked on entry to signal handler.<dt>SS_ONSTACK<dd>Process is executing on an alternate signal stack.<dt>SS_DISABLE<dd>Alternate signal stack is disabled.<dt>MINSIGSTKSZ<dd>Minimum stack size for a signal handler.<dt>SIGSTKSZ<dd>Default size in bytes for the alternate signal stack.</dl><p>The <b>ucontext_t</b> structure is defined through typedef as described in<i><a href="ucontext.h.html">&lt;ucontext.h&gt;</a></i>.<p>The<i>&lt;signal.h&gt;</i>header defines the<b>stack_t</b>type as a structure that includes at least the following members:<pre><code>void     *ss_sp       stack base or pointersize_t    ss_size     stack sizeint       ss_flags    flags</code></pre><p>The<i>&lt;signal.h&gt;</i>header defines the <b>sigstack</b> structure that includes at least thefollowing members:<pre><code>int       ss_onstack  non-zero when signal stack is in usevoid     *ss_sp       signal stack pointer</code></pre><p>The<i>&lt;signal.h&gt;</i>header defines the<b>siginfo_t</b>type as a structure that includes at least the following members:<pre><code>int           si_signo  signal numberint           si_errno  if non-zero, an <i>errno</i> value associated with                        this signal, as defined in &lt;<b>errno.h</b>&gt;int           si_code   signal codepid_t         si_pid    sending process IDuid_t         si_uid    real user ID of sending processvoid         *si_addr   address of faulting instructionint           si_status exit value or signallong          si_band   band event for SIGPOLLunion sigval  si_value  signal value</code></pre><p>The macros specified in the<b>Code</b>column of the following table are defined for use as values of<b>si_code</b> that are signal-specific reasons why the signal wasgenerated.<p><table  border=1 align=center><tr valign=top><th align=center><b>Signal</b><th align=center><b>Code</b><th align=center><b>Reason</b><tr valign=top><td align=left>SIGILL<td align=left>ILL_ILLOPC<td align=left>illegal opcode<tr valign=top><td align=left>&nbsp;<td align=left>ILL_ILLOPN<td align=left>illegal operand<tr valign=top><td align=left>&nbsp;<td align=left>ILL_ILLADR<td align=left>illegal addressing mode<tr valign=top><td align=left>&nbsp;<td align=left>ILL_ILLTRP<td align=left>illegal trap<tr valign=top><td align=left>&nbsp;<td align=left>ILL_PRVOPC<td align=left>privileged opcode<tr valign=top><td align=left>&nbsp;<td align=left>ILL_PRVREG<td align=left>privileged register<tr valign=top><td align=left>&nbsp;<td align=left>ILL_COPROC<td align=left>coprocessor error<tr valign=top><td align=left>&nbsp;<td align=left>ILL_BADSTK<td align=left>internal stack error<tr valign=top><td align=left>SIGFPE<td align=left>FPE_INTDIV<td align=left>integer divide by zero<tr valign=top><td align=left>&nbsp;<td align=left>FPE_INTOVF<td align=left>integer overflow<tr valign=top><td align=left>&nbsp;<td align=left>FPE_FLTDIV<td align=left>floating point divide by zero<tr valign=top><td align=left>&nbsp;<td align=left>FPE_FLTOVF<td align=left>floating point overflow<tr valign=top><td align=left>&nbsp;<td align=left>FPE_FLTUND<td align=left>floating point underflow<tr valign=top><td align=left>&nbsp;<td align=left>FPE_FLTRES<td align=left>floating point inexact result<tr valign=top><td align=left>&nbsp;<td align=left>FPE_FLTINV<td align=left>invalid floating point operation<tr valign=top><td align=left>&nbsp;<td align=left>FPE_FLTSUB<td align=left>subscript out of range<tr valign=top><td align=left>SIGSEGV<td align=left>SEGV_MAPERR<td align=left>address not mapped to object<tr valign=top><td align=left>&nbsp;<td align=left>SEGV_ACCERR<td align=left>invalid permissions for mapped object<tr valign=top><td align=left>SIGBUS<td align=left>BUS_ADRALN<td align=left>invalid address alignment<tr valign=top><td align=left>&nbsp;<td align=left>BUS_ADRERR<td align=left>non-existent physical address<tr valign=top><td align=left>&nbsp;<td align=left>BUS_OBJERR<td align=left>object specific hardware error<tr valign=top><td align=left>SIGTRAP<td align=left>TRAP_BRKPT<td align=left>process breakpoint<tr valign=top><td align=left>&nbsp;<td align=left>TRAP_TRACE<td align=left>process trace trap<tr valign=top><td align=left>SIGCHLD<td align=left>CLD_EXITED<td align=left>child has exited<tr valign=top><td align=left>&nbsp;<td align=left>CLD_KILLED<td align=left>child has terminated abnormally and did not create a core file<tr valign=top><td align=left>&nbsp;<td align=left>CLD_DUMPED<td align=left>child has terminated abnormally and created a core file<tr valign=top><td align=left>&nbsp;<td align=left>CLD_TRAPPED<td align=left>traced child has trapped<tr valign=top><td align=left>&nbsp;<td align=left>CLD_STOPPED<td align=left>child has stopped<tr valign=top><td align=left>&nbsp;<td align=left>CLD_CONTINUED<td align=left>stopped child has continued<tr valign=top><td align=left>SIGPOLL<td align=left>POLL_IN<td align=left>data input available<tr valign=top><td align=left>&nbsp;<td align=left>POLL_OUT<td align=left>output buffers available<tr valign=top><td align=left>&nbsp;<td align=left>POLL_MSG<td align=left>input message available<tr valign=top><td align=left>&nbsp;<td align=left>POLL_ERR<td align=left>I/O error<tr valign=top><td align=left>&nbsp;<td align=left>POLL_PRI<td align=left>high priority input available<tr valign=top><td align=left>&nbsp;<td align=left>POLL_HUP<td align=left>device disconnected<tr valign=top><td align=left>&nbsp;<td align=left>SI_USER<td align=left>signal sent by <i>kill</i>()<tr valign=top><td align=left>&nbsp;<td align=left>SI_QUEUE<td align=left>signal sent by the <i>sigqueue</i>()<tr valign=top><td align=left>&nbsp;<td align=left>SI_TIMER<td align=left>signal generated by expiration of a timer set by <i>timer_settime</i>()<tr valign=top><td align=left>&nbsp;<td align=left>SI_ASYNCIO<td align=left>signal generated by completion of an asynchronous I/O request<tr valign=top><td align=left>&nbsp;<td align=left>SI_MESGQ<td align=left>signal generated by arrival of a message on an empty message queue</table><br><p>Implementations may support additional <b>si_code</b> values not included inthis list, may generate values included in this list under circumstances otherthan those described in this list, and may contain extensions or limitationsthat prevent some values from being generated.  Implementations will notgenerate a different value from the ones described in this list forcircumstances described in this list.<p>In addition, the following signal-specific information will be available:<p><table   border=1 align=center><tr valign=top><th align=center><b>Signal</b><th align=center><b>Member</b><th align=center><b>Value</b><tr valign=top><td align=left>SIGILL<br>SIGFPE<td align=left><b>void * si_addr</b><td align=left><i>address of faulting instruction</i><tr valign=top><td align=left>SIGSEGV<br>SIGBUS<td align=left><b>void * si_addr</b><td align=left><i>address of faulting memory reference</i><tr valign=top><td align=left>SIGCHLD<td align=left><b>pid_t si_pid<br>int si_status<br>uid_t si_uid</b><td align=left><i>child process ID<br>exit value or signal<br>real user ID of the process that sent the signal</i><tr valign=top><td align=left>SIGPOLL<td align=left><b>long si_band</b><td align=left><i>band event for POLL_IN, POLL_OUT or POLL_MSG</i></table><p>For some implementations, the value of <i>si_addr</i> may be inaccurate.<p>The following are declared as functions and may also be defined as macros.<pre><code>void (*<a href="bsd_signal.html">bsd_signal</a>(int, void (*)(int)))(int);int    <a href="kill.html">kill</a>(pid_t, int);int    <a href="killpg.html">killpg</a>(pid_t, int);int    <a href="pthread_kill.html">pthread_kill</a>(pthread_t, int);int    <a href="pthread_sigmask.html">pthread_sigmask</a>(int, const sigset_t *, sigset_t *);int    <a href="raise.html">raise</a>(int);int    <a href="sigaction.html">sigaction</a>(int, const struct sigaction *, struct sigaction *);int    <a href="sigaddset.html">sigaddset</a>(sigset_t *, int);int    <a href="sigaltstack.html">sigaltstack</a>(const stack_t *, stack_t *);int    <a href="sigdelset.html">sigdelset</a>(sigset_t *, int);int    <a href="sigemptyset.html">sigemptyset</a>(sigset_t *);int    <a href="sigfillset.html">sigfillset</a>(sigset_t *);int    <a href="sighold.html">sighold</a>(int);int    <a href="sigignore.html">sigignore</a>(int);int    <a href="siginterrupt.html">siginterrupt</a>(int, int);int    <a href="sigismember.html">sigismember</a>(const sigset_t *, int);void (*<a href="signal.html">signal</a>(int, void (*)(int)))(int);int    <a href="sigpause.html">sigpause</a>(int);int    <a href="sigpending.html">sigpending</a>(sigset_t *);int    <a href="sigprocmask.html">sigprocmask</a>(int, const sigset_t *, sigset_t *);int    <a href="sigqueue.html">sigqueue</a>(pid_t, int, const union sigval);int    <a href="sigrelse.html">sigrelse</a>(int);void (*<a href="sigset.html">sigset</a>(int, void (*)(int)))(int);int    <a href="sigstack.html">sigstack</a>(struct sigstack *<i>ss</i>,           struct sigstack *<i>oss</i>); <b>(LEGACY)</b>int    <a href="sigsuspend.html">sigsuspend</a>(const sigset_t *);int    <a href="sigtimedwait.html">sigtimedwait</a>(const sigset_t *, siginfo_t *,           const struct timespec *);int    <a href="sigwait.html">sigwait</a>(const sigset_t *<i>set</i>, int *<i>sig</i>);int    <a href="sigwaitinfo.html">sigwaitinfo</a>(const sigset_t *, siginfo_t *);</code></pre></blockquote><h4><a name = "tag_000_008_666">&nbsp;</a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_667">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_668">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="alarm.html">alarm()</a></i>,<i><a href="bsd_signal.html">bsd_signal()</a></i>,<i><a href="ioctl.html">ioctl()</a></i>,<i><a href="kill.html">kill()</a></i>,<i><a href="killpg.html">killpg()</a></i>,<i><a href="raise.html">raise()</a></i>,<i><a href="sigaction.html">sigaction()</a></i>,<i><a href="sigaddset.html">sigaddset()</a></i>,<i><a href="sigaltstack.html">sigaltstack()</a></i>,<i><a href="sigdelset.html">sigdelset()</a></i>,<i><a href="sigemptyset.html">sigemptyset()</a></i>,<i><a href="sigfillset.html">sigfillset()</a></i>,<i><a href="siginterrupt.html">siginterrupt()</a></i>,<i><a href="sigismember.html">sigismember()</a></i>,<i><a href="signal.html">signal()</a></i>,<i><a href="sigpending.html">sigpending()</a></i>,<i><a href="sigprocmask.html">sigprocmask()</a></i>,<i><a href="sigqueue.html">sigqueue()</a></i>,<i><a href="sigsuspend.html">sigsuspend()</a></i>,<i><a href="sigwaitinfo.html">sigwaitinfo()</a></i>,<i><a href="wait.html">wait()</a></i>,<i><a href="waitid.html">waitid()</a></i>,<i><a href="errno.h.html">&lt;errno.h&gt;</a></i>,<i><a href="stropts.h.html">&lt;stropts.h&gt;</a></i>,<i><a href="systypes.h.html">&lt;sys/types.h&gt;</a></i>,<i><a href="ucontext.h.html">&lt;ucontext.h&gt;</a></i>.</blockquote><hr size=2 noshade><center><font size=2>UNIX &reg; is a registered Trademark of The Open Group.<br>Copyright &copy; 1997 The Open Group<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]</font></center><hr size=2 noshade></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -