📄 signal.h.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy, see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 --><!-- Copyright (c) 2001-2003 The Open Group, All Rights Reserved --><title><signal.h></title></head><body bgcolor="white"><script type="text/javascript" language="JavaScript" src="../jscript/codes.js"></script><basefont size="3"> <a name="<signal.h>"></a> <a name="tag_13_43"></a><!-- <signal.h> --> <!--header start--><center><font size="2">The Open Group Base Specifications Issue 6<br>IEEE Std 1003.1, 2003 Edition<br>Copyright © 2001-2003 The IEEE and The Open Group, All Rights reserved.</font></center><!--header end--><hr size="2" noshade><h4><a name="tag_13_43_01"></a>NAME</h4><blockquote>signal.h - signals</blockquote><h4><a name="tag_13_43_02"></a>SYNOPSIS</h4><blockquote class="synopsis"><p><tt>#include <signal.h></tt></p></blockquote><h4><a name="tag_13_43_03"></a>DESCRIPTION</h4><blockquote><div class="box"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> Some of the functionality described on this reference page extends the ISO C standard. Applications shall definethe appropriate feature test macro (see the System Interfaces volume of IEEE Std 1003.1-2001, <a href="../functions/xsh_chap02_02.html">Section 2.2, The Compilation Environment</a>) to enable the visibility of these symbols in thisheader. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></div><p>The <i><signal.h></i> header shall define the following symbolic constants, each of which expands to a distinct constantexpression of the type:</p><pre><tt>void (*)(int)</tt></pre><p>whose value matches no declarable function.</p><dl compact><dt>SIG_DFL</dt><dd>Request for default signal handling.</dd><dt>SIG_ERR</dt><dd>Return value from <a href="../functions/signal.html"><i>signal</i>()</a> in case of error.</dd><dt>SIG_HOLD</dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Request that signal be held. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>SIG_IGN</dt><dd>Request that signal be ignored.</dd></dl><p>The following data types shall be defined through <b>typedef</b>:</p><dl compact><dt><b>sig_atomic_t</b></dt><dd>Possibly volatile-qualified integer type of an object that can be accessed as an atomic entity, even in the presence ofasynchronous interrupts.</dd><dt><b>sigset_t</b></dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Integer or structure type of an object used to represent sets of signals. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd><dt><b>pid_t</b></dt><dd><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> Asdescribed in <a href="sys/types.h.html"><i><sys/types.h></i></a> . <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd></dl><p><sup>[<a href="javascript:open_code('RTS')">RTS</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The <i><signal.h></i> header shall define the <b>sigevent</b> structure, which has at least the following members:</p><pre><tt>int sigev_notify </tt> Notification type. <tt>int sigev_signo </tt> Signal number. <tt>union sigval sigev_value </tt> Signal value. <tt>void(*)(union sigval) sigev_notify_function </tt> Notification function. <tt>(pthread_attr_t *) sigev_notify_attributes</tt> Notification attributes. <tt></tt></pre><p>The following values of <i>sigev_notify</i> shall be defined:</p><dl compact><dt>SIGEV_NONE</dt><dd>No asynchronous notification is delivered when the event of interest occurs.</dd><dt>SIGEV_SIGNAL</dt><dd>A queued signal, with an application-defined value, is generated when the event of interest occurs.</dd><dt>SIGEV_THREAD</dt><dd>A notification function is called to perform notification.</dd></dl><p>The <b>sigval</b> union shall be defined as:</p><pre><tt>int sival_int </tt> Integer signal value. <tt>void *sival_ptr </tt> Pointer signal value. <tt></tt></pre><p>This header shall also declare the macros SIGRTMIN and SIGRTMAX, which evaluate to integer expressions, and specify a range ofsignal numbers that are reserved for application use and for which the realtime signal behavior specified in this volume ofIEEE Std 1003.1-2001 is supported. The signal numbers in this range do not overlap any of the signals specified in thefollowing table.</p><p>The range SIGRTMIN through SIGRTMAX inclusive shall include at least {RTSIG_MAX} signal numbers.</p><p>It is implementation-defined whether realtime signal behavior is supported for other signals. <img src="../images/opt-end.gif"alt="[Option End]" border="0"></p><p>This header also declares the constants that are used to refer to the signals that occur in the system. Signals defined herebegin with the letters SIG. Each of the signals have distinct positive integer values. The value 0 is reserved for use as the nullsignal (see <a href="../functions/kill.html"><i>kill</i>()</a>). Additional implementation-defined signals may occur in thesystem.</p><p><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> TheISO C standard only requires the signal names SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, and SIGTERM to be defined. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p><p>The following signals shall be supported on all implementations (default actions are explained below the table):</p><center><table border="1" cellpadding="3" align="center"><tr valign="top"><th align="center"><p class="tent"><b>Signal</b></p></th><th align="center"><p class="tent"><b>Default Action</b></p></th><th align="center"><p class="tent"><b>Description</b></p></th></tr><tr valign="top"><td align="left"><p class="tent">SIGABRT</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Process abort signal.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGALRM</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Alarm clock.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGBUS</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Access to an undefined portion of a memory object.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGCHLD</p></td><td align="left"><p class="tent">I</p></td><td align="left"><p class="tent">Child process terminated, stopped,</p></td></tr><tr valign="top"><td align="left"><p class="tent"><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> </p></td><td align="left"><p class="tent"> </p></td><td align="left"><p class="tent">or continued. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGCONT</p></td><td align="left"><p class="tent">C</p></td><td align="left"><p class="tent">Continue executing, if stopped.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGFPE</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Erroneous arithmetic operation.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGHUP</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Hangup.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGILL</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Illegal instruction.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGINT</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Terminal interrupt signal.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGKILL</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Kill (cannot be caught or ignored).</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGPIPE</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Write on a pipe with no one to read it.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGQUIT</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Terminal quit signal.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGSEGV</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Invalid memory reference.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGSTOP</p></td><td align="left"><p class="tent">S</p></td><td align="left"><p class="tent">Stop executing (cannot be caught or ignored).</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGTERM</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Termination signal.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGTSTP</p></td><td align="left"><p class="tent">S</p></td><td align="left"><p class="tent">Terminal stop signal.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGTTIN</p></td><td align="left"><p class="tent">S</p></td><td align="left"><p class="tent">Background process attempting read.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGTTOU</p></td><td align="left"><p class="tent">S</p></td><td align="left"><p class="tent">Background process attempting write.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGUSR1</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">User-defined signal 1.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGUSR2</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">User-defined signal 2.</p></td></tr><tr valign="top"><td align="left"><p class="tent"><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> SIGPOLL</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Pollable event.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGPROF</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Profiling timer expired.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGSYS</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Bad system call.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGTRAP</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">Trace/breakpoint trap. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGURG</p></td><td align="left"><p class="tent">I</p></td><td align="left"><p class="tent">High bandwidth data is available at a socket.</p></td></tr><tr valign="top"><td align="left"><p class="tent"><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"border="0"> SIGVTALRM</p></td><td align="left"><p class="tent">T</p></td><td align="left"><p class="tent">Virtual timer expired.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGXCPU</p></td><td align="left"><p class="tent">A</p></td><td align="left"><p class="tent">CPU time limit exceeded.</p></td></tr><tr valign="top"><td align="left"><p class="tent">SIGXFSZ</p></td><td align="left"><p class="tent">A</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -