📄 sigwaitinfo.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>sigwaitinfo</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_768"> </a>NAME</h4><blockquote>sigwaitinfo, sigtimedwait - wait for queued signals(<b>REALTIME</b>)</blockquote><h4><a name = "tag_000_008_769"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="signal.h.html">signal.h</a>>int sigwaitinfo(const sigset_t *<i>set</i>, siginfo_t *<i>info</i>);int sigtimedwait(const sigset_t *<i>set</i>, siginfo_t *<i>info</i>, const struct timespec *<i>timeout</i>);</code></pre></blockquote><h4><a name = "tag_000_008_770"> </a>DESCRIPTION</h4><blockquote>The function<i>sigwaitinfo()</i>selects the pending signal from the set specified by<i>set</i>.Should any of multiple pending signals in the rangeSIGRTMIN to SIGRTMAX be selected,it will be the lowest numbered one.The selection order between realtime and non-realtime signals,or between multiple pending non-realtime signals, is unspecified.If no signal in<i>set</i>is pending at the time of the call,the calling thread is suspended until one or more signals in<i>set</i>become pending or until it is interrupted by an unblocked, caught signal.<p>The function<i>sigwaitinfo()</i>behaves the same as the<i><a href="sigwait.html">sigwait()</a></i>function if the<i>info</i>argument is NULL.If the<i>info</i>argument is non-NULL, the<i>sigwaitinfo()</i>function behaves the same as<i>sigwait,</i>()except that the selected signal number is stored in the<i>si_signo</i>member, and the cause of the signal is stored in the<i>si_code</i>member.If any value is queued to the selectedsignal, the first such queued value is dequeued and, if the<i>info</i>argument is non-NULL, the value is stored in the<i>si_value</i>member of<i>info</i>.The system resource used to queue the signal will be releasedand made available to queue other signals.If no value is queued, thecontent of the<i>si_value</i>member is undefined.If no further signalsare queued for the selected signal,the pending indication for that signal will be reset.<p>The function<i>sigtimedwait()</i>behaves the same as<i>sigwaitinfo()</i>except that if none of the signals specified by<i>set</i>are pending,<i>sigtimedwait()</i>waits for the time interval specified in the<b>timespec</b>structure referenced by<i>timeout</i>.If the<b>timespec</b>structure pointed to by<i>timeout</i>is zero-valued and if none of the signals specified by<i>set</i>are pending, then<i>sigtimedwait()</i>returns immediately with an error.If<i>timeout</i>is the NULL pointer, the behaviour is unspecified.</blockquote><h4><a name = "tag_000_008_771"> </a>RETURN VALUE</h4><blockquote>Upon successful completion (that is, one ofthe signals specified by<i>set</i>is pending or is generated)<i>sigwaitinfo()</i>and<i>sigtimedwait()</i>will return the selected signal number.Otherwise, the function returns a value of -1 and sets<i>errno</i>to indicate the error.</blockquote><h4><a name = "tag_000_008_772"> </a>ERRORS</h4><blockquote>The <i>sigwaitinfo()</i>and<i>sigtimedwait()</i>functions will fail if:<dl compact><dt>[ENOSYS]<dd>The functions<i>sigwaitinfo()</i>and<i>sigtimedwait()</i>are not supported by this implementation.</dl><p>The <i>sigtimedwait()</i>function will also fail if:<dl compact><dt>[EAGAIN]<dd>No signal specified by<i>set</i>was generated within the specified timeout period.</dl><p>The <i>sigwaitinfo()</i>and<i>sigtimedwait()</i>functions may fail if:<dl compact><dt>[EINTR]<dd>The wait was interrupted by an unblocked, caught signal.It will be documented in system documentation whether this error willcause these functions to fail.</dl><br><p>The<i>sigtimedwait()</i>function may also fail if:<dl compact><dt>[EINVAL]<dd>The<i>timeout</i>argument specified a<i>tv_nsec</i>value less than zero or greater than or equal to 1000 million.</dl><p>An implementation only checks for this error if no signal ispending in<i>set</i>and it is necessary to wait.</blockquote><h4><a name = "tag_000_008_773"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_774"> </a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_775"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_776"> </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="sigwait.html">sigwait()</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 + -