📄 sigwait.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>sigwait</title></head><body bgcolor=white><center><font size=2>The Single UNIX ® Specification, Version 2<br>Copyright © 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_008_759"> </a>NAME</h4><blockquote>sigwait - wait for queued signals</blockquote><h4><a name = "tag_000_008_760"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="signal.h.html">signal.h</a>>int sigwait(const sigset_t *<i>set</i>, int *<i>sig</i>);</code></pre></blockquote><h4><a name = "tag_000_008_761"> </a>DESCRIPTION</h4><blockquote>The<i>sigwait()</i>function selects a pending signal from<i>set</i>,atomically clears it from thesystem's set of pending signals,and returns that signal number in the location referenced by<i>sig</i>.If prior to the call to<i>sigwait()</i>there are multiple pending instances of a single signal number,it is implementation-dependentwhether upon successful return there are any remaining pendingsignals for that signal number.If the implementation supports queued signals andthere are multiple signals queued for the signal number selected,the first such queued signal causes a return from<i>sigwait()</i>and the remainder remain queued.If no signal in<i>set</i>is pending at the time of the call,the thread is suspended until one or more becomes pending.The signals defined by<i>set</i>will been blocked at the time of the call to<i>sigwait()</i>;otherwise the behaviour is undefined.The effect of<i>sigwait()</i>on the signal actions for the signals in<i>set</i>is unspecified.<p>If more than one thread is using<i>sigwait()</i>to wait for the same signal,no more than one of these threads will return from<i>sigwait()</i>with the signal number.Which thread returns from<i>sigwait()</i>if more than a single thread is waiting is unspecified.<p>Should any of the multiple pending signals in the range SIGRTMIN toSIGRTMAX be selected, it shall be the lowest numbered one.The selection order between realtime and non-realtime signals, orbetween multiple pending non-realtime signals, is unspecified.</blockquote><h4><a name = "tag_000_008_762"> </a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>sigwait()</i>stores the signal number of the received signalat the location referenced by<i>sig</i>and returns zero.Otherwise, an error number is returned to indicate the error.</blockquote><h4><a name = "tag_000_008_763"> </a>ERRORS</h4><blockquote>The<i>sigwait()</i>function may fail if:<dl compact><dt>[EINVAL]<dd>The<i>set</i>argument contains an invalid or unsupported signal number.</dl></blockquote><h4><a name = "tag_000_008_764"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_765"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_766"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_767"> </a>SEE ALSO</h4><blockquote><i><a href="pause.html">pause()</a></i>,<i><a href="pthread_sigmask.html">pthread_sigmask()</a></i>,<i><a href="sigaction.html">sigaction()</a></i>,<i><a href="signal.h.html"><signal.h></a></i>,<i><a href="sigpending.html">sigpending()</a></i>,<i><a href="sigsuspend.html">sigsuspend()</a></i>,<i><a href="sigwaitinfo.html">sigwaitinfo()</a></i>,<i><a href="time.h.html"><time.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995) and the POSIX Threads Extension (1003.1c-1995)</blockquote><hr size=2 noshade><center><font size=2>UNIX ® is a registered Trademark of The Open Group.<br>Copyright © 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 + -