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

📄 sigprocmask.html

📁 unix 下的C开发手册,还用详细的例程。
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>sigprocmask</title></head><body bgcolor=white><center><font size=2>The Single UNIX &reg; Specification, Version 2<br>Copyright &copy; 1997 The Open Group</font></center><hr size=2 noshade><h4><a name = "tag_000_008_693">&nbsp;</a>NAME</h4><blockquote>sigprocmask, pthread_sigmask - examine and change blocked signals</blockquote><h4><a name = "tag_000_008_694">&nbsp;</a>SYNOPSIS</h4><blockquote><pre><code>#include &lt;<a href="signal.h.html">signal.h</a>&gt;int sigprocmask(int <i>how</i>, const sigset_t *<i>set</i>, sigset_t *<i>oset</i>);int pthread_sigmask(int <i>how</i>, const sigset_t *<i>set</i>, sigset_t *<i>oset</i>);</code></pre></blockquote><h4><a name = "tag_000_008_695">&nbsp;</a>DESCRIPTION</h4><blockquote>In a single-threaded process, the<i>sigprocmask()</i>function allows the calling process to examine or change (or both)the signal mask of the calling thread.<p>If the argument<i>set</i>is not a null pointer, it points to a set of signals to be usedto change the currently blocked set.<p>The argument<i>how</i>indicates the way in which the set is changed, and consists ofone of the following values:<dl compact><dt>SIG_BLOCK<dd>The resulting set will be the union of the current set and the signalset pointed to by <i>set</i>.<dt>SIG_SETMASK<dd>The resulting set will be the signal set pointed to by <i>set</i>.<dt>SIG_UNBLOCK<dd>The resulting set will be the intersection of the currentset and the complement of the signal set pointed to by <i>set</i>.</dl><p>If the argument<i>oset</i>is not a null pointer, the previous mask is stored in the locationpointed to by <i>oset</i>.If <i>set</i> is a null pointer, the value of theargument <i>how</i> is not significant and the process' signalmask is unchanged; thus the call can be used to enquire aboutcurrently blocked signals.<p>If there are any pending unblocked signals after the call to<i>sigprocmask()</i>,at least one of those signals will be delivered before the call to<i>sigprocmask()</i>returns.<p>It is not possible to block those signals which cannot beignored.This is enforced by the system without causing an error to be indicated.<p>If any of the SIGFPE, SIGILL, SIGSEGV or SIGBUSsignals are generatedwhile they are blocked, the result is undefined, unless thesignal was generated by a function capable of sending a signal to a specific process or thread.<p>If<i>sigprocmask()</i>fails, the thread's signal mask is not changed.<p>The use of the<i>sigprocmask()</i>function is unspecified in a multi-threaded process.<p>The<i><a href="pthread_sigmask.html">pthread_sigmask()</a></i>function is used to examine or change (or both)the calling thread's signal mask,regardless of the number of threads in the process.The effect is the same as described for<i>sigprocmask()</i>,without the restriction that the call be made in a single-threadedprocess.</blockquote><h4><a name = "tag_000_008_696">&nbsp;</a>RETURN VALUE</h4><blockquote>Upon successful completion,<i>sigprocmask()</i>returns 0.  Otherwise -1 is returned,<i>errno</i>is set to indicate the error and the process' signal mask will be unchanged.<p>Upon successful completion<i><a href="pthread_sigmask.html">pthread_sigmask()</a></i>returns 0; otherwise it returns the corresponding error number.</blockquote><h4><a name = "tag_000_008_697">&nbsp;</a>ERRORS</h4><blockquote>The<i>sigprocmask()</i>and<i><a href="pthread_sigmask.html">pthread_sigmask()</a></i>functions will fail if:<dl compact><dt>[EINVAL]<dd>The value of the <i>how</i> argument is not equal to one of thedefined values.</dl><p>The<i><a href="pthread_sigmask.html">pthread_sigmask()</a></i>function will not return an error code of [EINTR].</blockquote><h4><a name = "tag_000_008_698">&nbsp;</a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_699">&nbsp;</a>APPLICATION USAGE</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_700">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_701">&nbsp;</a>SEE ALSO</h4><blockquote><i><a href="sigaction.html">sigaction()</a></i>,<i><a href="sigaddset.html">sigaddset()</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="sigismember.html">sigismember()</a></i>,<i><a href="sigpending.html">sigpending()</a></i>,<i><a href="sigqueue.html">sigqueue()</a></i>,<i><a href="sigsuspend.html">sigsuspend()</a></i>,<i><a href="signal.h.html">&lt;signal.h&gt;</a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from the POSIX.1-1988 standard.</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 + -