📄 xsh_chap02_04.html
字号:
<dd><sup>[<a href="javascript:open_code('RTS')">RTS</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The signal was generated by the expiration of a timer set by <a href="../functions/timer_settime.html"><i>timer_settime</i>()</a>.<img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd><dt>SI_ASYNCIO</dt><dd><sup>[<a href="javascript:open_code('RTS')">RTS</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The signal was generated by the completion of an asynchronous I/O request. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd><dt>SI_MESGQ</dt><dd><sup>[<a href="javascript:open_code('RTS')">RTS</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">The signal was generated by the arrival of a message on an empty message queue. <img src="../images/opt-end.gif" alt="[Option End]"border="0"></dd></dl><p>If the signal was not generated by one of the functions or events listed above, the <i>si_code</i> shall be set to animplementation-defined value that is not equal to any of the values defined above.</p><p><sup>[<a href="javascript:open_code('RTS')">RTS</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">If the Realtime Signals Extension is supported, and <i>si_code</i> is one of SI_QUEUE, SI_TIMER, SI_ASYNCIO, or SI_MESGQ, then<i>si_value</i> shall contain the application-specified signal value. Otherwise, the contents of <i>si_value</i> are undefined.<img src="../images/opt-end.gif" alt="[Option End]" border="0"></p><p>The behavior of a process is undefined after it returns normally from a signal-catching function for a <sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> SIGBUS, <imgsrc="../images/opt-end.gif" alt="[Option End]" border="0"> SIGFPE, SIGILL, or SIGSEGV signal that was not generated by <a href="../functions/kill.html"><i>kill</i>()</a>, <sup>[<a href="javascript:open_code('RTS')">RTS</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0"> <a href="../functions/sigqueue.html"><i>sigqueue</i>()</a>, <img src="../images/opt-end.gif" alt="[Option End]" border="0"> or <a href="../functions/raise.html"><i>raise</i>()</a>.</p><p>The system shall not allow a process to catch the signals SIGKILL and SIGSTOP.</p><p>If a process establishes a signal-catching function for the SIGCHLD signal while it has a terminated child process for which ithas not waited, it is unspecified whether a SIGCHLD signal is generated to indicate that child process.</p><p>When signal-catching functions are invoked asynchronously with process execution, the behavior of some of the functions definedby this volume of IEEE Std 1003.1-2001 is unspecified if they are called from a signal-catching function.</p><p>The following table defines a set of functions that shall be either reentrant or non-interruptible by signals and shall beasync-signal-safe. Therefore applications may invoke them, without restriction, from signal-catching functions:</p><table cellpadding="3"><tr valign="top"><td align="left"><p class="tent"><br><a href="../functions/_Exit.html"><i>_Exit</i>()</a><br><a href="../functions/_exit.html"><i>_exit</i>()</a><br><a href="../functions/abort.html"><i>abort</i>()</a><br><a href="../functions/accept.html"><i>accept</i>()</a><br><a href="../functions/access.html"><i>access</i>()</a><br><a href="../functions/aio_error.html"><i>aio_error</i>()</a><br><a href="../functions/aio_return.html"><i>aio_return</i>()</a><br><a href="../functions/aio_suspend.html"><i>aio_suspend</i>()</a><br><a href="../functions/alarm.html"><i>alarm</i>()</a><br><a href="../functions/bind.html"><i>bind</i>()</a><br><a href="../functions/cfgetispeed.html"><i>cfgetispeed</i>()</a><br><a href="../functions/cfgetospeed.html"><i>cfgetospeed</i>()</a><br><a href="../functions/cfsetispeed.html"><i>cfsetispeed</i>()</a><br><a href="../functions/cfsetospeed.html"><i>cfsetospeed</i>()</a><br><a href="../functions/chdir.html"><i>chdir</i>()</a><br><a href="../functions/chmod.html"><i>chmod</i>()</a><br><a href="../functions/chown.html"><i>chown</i>()</a><br><a href="../functions/clock_gettime.html"><i>clock_gettime</i>()</a><br><a href="../functions/close.html"><i>close</i>()</a><br><a href="../functions/connect.html"><i>connect</i>()</a><br><a href="../functions/creat.html"><i>creat</i>()</a><br><a href="../functions/dup.html"><i>dup</i>()</a><br><a href="../functions/dup2.html"><i>dup2</i>()</a><br><a href="../functions/execle.html"><i>execle</i>()</a><br><a href="../functions/execve.html"><i>execve</i>()</a><br><a href="../functions/fchmod.html"><i>fchmod</i>()</a><br><a href="../functions/fchown.html"><i>fchown</i>()</a><br><a href="../functions/fcntl.html"><i>fcntl</i>()</a><br><a href="../functions/fdatasync.html"><i>fdatasync</i>()</a><br><a href="../functions/fork.html"><i>fork</i>()</a><br> </p></td><td align="left"><p class="tent"><br><a href="../functions/fpathconf.html"><i>fpathconf</i>()</a><br><a href="../functions/fstat.html"><i>fstat</i>()</a><br><a href="../functions/fsync.html"><i>fsync</i>()</a><br><a href="../functions/ftruncate.html"><i>ftruncate</i>()</a><br><a href="../functions/getegid.html"><i>getegid</i>()</a><br><a href="../functions/geteuid.html"><i>geteuid</i>()</a><br><a href="../functions/getgid.html"><i>getgid</i>()</a><br><a href="../functions/getgroups.html"><i>getgroups</i>()</a><br><a href="../functions/getpeername.html"><i>getpeername</i>()</a><br><a href="../functions/getpgrp.html"><i>getpgrp</i>()</a><br><a href="../functions/getpid.html"><i>getpid</i>()</a><br><a href="../functions/getppid.html"><i>getppid</i>()</a><br><a href="../functions/getsockname.html"><i>getsockname</i>()</a><br><a href="../functions/getsockopt.html"><i>getsockopt</i>()</a><br><a href="../functions/getuid.html"><i>getuid</i>()</a><br><a href="../functions/kill.html"><i>kill</i>()</a><br><a href="../functions/link.html"><i>link</i>()</a><br><a href="../functions/listen.html"><i>listen</i>()</a><br><a href="../functions/lseek.html"><i>lseek</i>()</a><br><a href="../functions/lstat.html"><i>lstat</i>()</a><br><a href="../functions/mkdir.html"><i>mkdir</i>()</a><br><a href="../functions/mkfifo.html"><i>mkfifo</i>()</a><br><a href="../functions/open.html"><i>open</i>()</a><br><a href="../functions/pathconf.html"><i>pathconf</i>()</a><br><a href="../functions/pause.html"><i>pause</i>()</a><br><a href="../functions/pipe.html"><i>pipe</i>()</a><br><a href="../functions/poll.html"><i>poll</i>()</a><br><a href="../functions/posix_trace_event.html"><i>posix_trace_event</i>()</a><br><a href="../functions/pselect.html"><i>pselect</i>()</a><br><a href="../functions/raise.html"><i>raise</i>()</a><br> </p></td><td align="left"><p class="tent"><br><a href="../functions/read.html"><i>read</i>()</a><br><a href="../functions/readlink.html"><i>readlink</i>()</a><br><a href="../functions/recv.html"><i>recv</i>()</a><br><a href="../functions/recvfrom.html"><i>recvfrom</i>()</a><br><a href="../functions/recvmsg.html"><i>recvmsg</i>()</a><br><a href="../functions/rename.html"><i>rename</i>()</a><br><a href="../functions/rmdir.html"><i>rmdir</i>()</a><br><a href="../functions/select.html"><i>select</i>()</a><br><a href="../functions/sem_post.html"><i>sem_post</i>()</a><br><a href="../functions/send.html"><i>send</i>()</a><br><a href="../functions/sendmsg.html"><i>sendmsg</i>()</a><br><a href="../functions/sendto.html"><i>sendto</i>()</a><br><a href="../functions/setgid.html"><i>setgid</i>()</a><br><a href="../functions/setpgid.html"><i>setpgid</i>()</a><br><a href="../functions/setsid.html"><i>setsid</i>()</a><br><a href="../functions/setsockopt.html"><i>setsockopt</i>()</a><br><a href="../functions/setuid.html"><i>setuid</i>()</a><br><a href="../functions/shutdown.html"><i>shutdown</i>()</a><br><a href="../functions/sigaction.html"><i>sigaction</i>()</a><br><a href="../functions/sigaddset.html"><i>sigaddset</i>()</a><br><a href="../functions/sigdelset.html"><i>sigdelset</i>()</a><br><a href="../functions/sigemptyset.html"><i>sigemptyset</i>()</a><br><a href="../functions/sigfillset.html"><i>sigfillset</i>()</a><br><a href="../functions/sigismember.html"><i>sigismember</i>()</a><br><a href="../functions/sleep.html"><i>sleep</i>()</a><br><a href="../functions/signal.html"><i>signal</i>()</a><br><a href="../functions/sigpause.html"><i>sigpause</i>()</a><br><a href="../functions/sigpending.html"><i>sigpending</i>()</a><br><a href="../functions/sigprocmask.html"><i>sigprocmask</i>()</a><br><a href="../functions/sigqueue.html"><i>sigqueue</i>()</a><br> </p></td><td align="left"><p class="tent"><br><a href="../functions/sigset.html"><i>sigset</i>()</a><br><a href="../functions/sigsuspend.html"><i>sigsuspend</i>()</a><br><a href="../functions/sockatmark.html"><i>sockatmark</i>()</a><br><a href="../functions/socket.html"><i>socket</i>()</a><br><a href="../functions/socketpair.html"><i>socketpair</i>()</a><br><a href="../functions/stat.html"><i>stat</i>()</a><br><a href="../functions/symlink.html"><i>symlink</i>()</a><br><a href="../functions/sysconf.html"><i>sysconf</i>()</a><br><a href="../functions/tcdrain.html"><i>tcdrain</i>()</a><br><a href="../functions/tcflow.html"><i>tcflow</i>()</a><br><a href="../functions/tcflush.html"><i>tcflush</i>()</a><br><a href="../functions/tcgetattr.html"><i>tcgetattr</i>()</a><br><a href="../functions/tcgetpgrp.html"><i>tcgetpgrp</i>()</a><br><a href="../functions/tcsendbreak.html"><i>tcsendbreak</i>()</a><br><a href="../functions/tcsetattr.html"><i>tcsetattr</i>()</a><br><a href="../functions/tcsetpgrp.html"><i>tcsetpgrp</i>()</a><br><a href="../functions/time.html"><i>time</i>()</a><br><a href="../functions/timer_getoverrun.html"><i>timer_getoverrun</i>()</a><br><a href="../functions/timer_gettime.html"><i>timer_gettime</i>()</a><br><a href="../functions/timer_settime.html"><i>timer_settime</i>()</a><br><a href="../functions/times.html"><i>times</i>()</a><br><a href="../functions/umask.html"><i>umask</i>()</a><br><a href="../functions/uname.html"><i>uname</i>()</a><br><a href="../functions/unlink.html"><i>unlink</i>()</a><br><a href="../functions/utime.html"><i>utime</i>()</a><br><a href="../functions/wait.html"><i>wait</i>()</a><br><a href="../functions/waitpid.html"><i>waitpid</i>()</a><br><a href="../functions/write.html"><i>write</i>()</a><br> </p></td></tr></table><p>All functions not in the above table are considered to be unsafe with respect to signals. In the presence of signals, allfunctions defined by this volume of IEEE Std 1003.1-2001 shall behave as defined when called from or interrupted by asignal-catching function, with a single exception: when a signal interrupts an unsafe function and the signal-catching functioncalls an unsafe function, the behavior is undefined.</p></dd></dl><p>When a signal is delivered to a thread, if the action of that signal specifies termination, stop, or continue, the entireprocess shall be terminated, stopped, or continued, respectively.</p><h4><a name="tag_02_04_04"> 2.4.4 </a>Signal Effects on Other Functions</h4><p>Signals affect the behavior of certain functions defined by this volume of IEEE Std 1003.1-2001 if delivered to aprocess while it is executing such a function. If the action of the signal is to terminate the process, the process shall beterminated and the function shall not return. If the action of the signal is to stop the process, the process shall stop untilcontinued or terminated. Generation of a SIGCONT signal for the process shall cause the process to be continued, and the originalfunction shall continue at the point the process was stopped. If the action of the signal is to invoke a signal-catching function,the signal-catching function shall be invoked; in this case the original function is said to be ``interrupted'' by the signal. Ifthe signal-catching function executes a <b>return</b> statement, the behavior of the interrupted function shall be as describedindividually for that function, except as noted for unsafe functions. Signals that are ignored shall not affect the behavior of anyfunction; signals that are blocked shall not affect the behavior of any function until they are unblocked and then delivered,except as specified for the <a href="../functions/sigpending.html"><i>sigpending</i>()</a> and <a href="../functions/sigwait.html"><i>sigwait</i>()</a> functions.</p><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -