222 lines
9.4 KiB
HTML
222 lines
9.4 KiB
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 The Open Group, All Rights Reserved -->
|
|
<title>pthread_sigmask</title>
|
|
</head>
|
|
<body bgcolor="white">
|
|
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
|
|
</script>
|
|
|
|
<basefont size="3"> <a name="pthread_sigmask"></a> <a name="tag_03_573"></a><!-- pthread_sigmask -->
|
|
<!--header start-->
|
|
<center><font size="2">The Open Group Base Specifications Issue 6<br>
|
|
IEEE Std 1003.1-2001<br>
|
|
Copyright © 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
|
|
|
|
<!--header end-->
|
|
<hr size="2" noshade>
|
|
<h4><a name="tag_03_573_01"></a>NAME</h4>
|
|
|
|
<blockquote>pthread_sigmask, sigprocmask - examine and change blocked signals</blockquote>
|
|
|
|
<h4><a name="tag_03_573_02"></a>SYNOPSIS</h4>
|
|
|
|
<blockquote class="synopsis">
|
|
<p><code><tt>#include <<a href="../basedefs/signal.h.html">signal.h</a>><br>
|
|
<br>
|
|
</tt></code></p>
|
|
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> int pthread_sigmask(int</tt> <i>how</i><tt>, const sigset_t *restrict</tt> <i>set</i><tt>,<br>
|
|
sigset_t *restrict</tt> <i>oset</i><tt>);<br>
|
|
<img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></code></div>
|
|
|
|
<div class="box"><code><tt><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt=
|
|
"[Option Start]" border="0"> int sigprocmask(int</tt> <i>how</i><tt>, const sigset_t *restrict</tt> <i>set</i><tt>,<br>
|
|
sigset_t *restrict</tt> <i>oset</i><tt>); <img src="../images/opt-end.gif" alt="[Option End]"
|
|
border="0"></tt></code></div>
|
|
|
|
<tt><br>
|
|
</tt></blockquote>
|
|
|
|
<h4><a name="tag_03_573_03"></a>DESCRIPTION</h4>
|
|
|
|
<blockquote>
|
|
<p><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The <i>pthread_sigmask</i>() function shall examine or change (or both) the calling thread's signal mask, regardless of the number
|
|
of threads in the process. The function shall be equivalent to <i>sigprocmask</i>(), without the restriction that the call be made
|
|
in a single-threaded process. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
|
|
|
|
<p>In a single-threaded process, the <i>sigprocmask</i>() function shall examine or change (or both) the signal mask of the calling
|
|
thread.</p>
|
|
|
|
<p>If the argument <i>set</i> is not a null pointer, it points to a set of signals to be used to change the currently blocked
|
|
set.</p>
|
|
|
|
<p>The argument <i>how</i> indicates the way in which the set is changed, and the application shall ensure it consists of one of
|
|
the following values:</p>
|
|
|
|
<dl compact>
|
|
<dt>SIG_BLOCK</dt>
|
|
|
|
<dd>The resulting set shall be the union of the current set and the signal set pointed to by <i>set</i>.</dd>
|
|
|
|
<dt>SIG_SETMASK</dt>
|
|
|
|
<dd>The resulting set shall be the signal set pointed to by <i>set</i>.</dd>
|
|
|
|
<dt>SIG_UNBLOCK</dt>
|
|
|
|
<dd>The resulting set shall be the intersection of the current set and the complement of the signal set pointed to by
|
|
<i>set</i>.</dd>
|
|
</dl>
|
|
|
|
<p>If the argument <i>oset</i> is not a null pointer, the previous mask shall be stored in the location pointed to by <i>oset</i>.
|
|
If <i>set</i> is a null pointer, the value of the argument <i>how</i> is not significant and the process' signal mask shall be
|
|
unchanged; thus the call can be used to enquire about currently blocked signals.</p>
|
|
|
|
<p>If there are any pending unblocked signals after the call to <i>sigprocmask</i>(), at least one of those signals shall be
|
|
delivered before the call to <i>sigprocmask</i>() returns.</p>
|
|
|
|
<p>It is not possible to block those signals which cannot be ignored. This shall be enforced by the system without causing an error
|
|
to be indicated.</p>
|
|
|
|
<p>If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are generated while they are blocked, the result is undefined, unless
|
|
the signal was generated by the <a href="../functions/kill.html"><i>kill</i>()</a> function, the <a href=
|
|
"../functions/sigqueue.html"><i>sigqueue</i>()</a> function, or the <a href="../functions/raise.html"><i>raise</i>()</a>
|
|
function.</p>
|
|
|
|
<p>If <i>sigprocmask</i>() fails, the thread's signal mask shall not be changed.</p>
|
|
|
|
<p>The use of the <i>sigprocmask</i>() function is unspecified in a multi-threaded process.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_04"></a>RETURN VALUE</h4>
|
|
|
|
<blockquote>
|
|
<p><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
Upon successful completion <i>pthread_sigmask</i>() shall return 0; otherwise, it shall return the corresponding error number. <img
|
|
src="../images/opt-end.gif" alt="[Option End]" border="0"></p>
|
|
|
|
<p>Upon successful completion, <i>sigprocmask</i>() shall return 0; otherwise, -1 shall be returned, <i>errno</i> shall be set to
|
|
indicate the error, and the process' signal mask shall be unchanged.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_05"></a>ERRORS</h4>
|
|
|
|
<blockquote>
|
|
<p><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The <i>pthread_sigmask</i>() <img src="../images/opt-end.gif" alt="[Option End]" border="0"> and <i>sigprocmask</i>() functions
|
|
shall fail if:</p>
|
|
|
|
<dl compact>
|
|
<dt>[EINVAL]</dt>
|
|
|
|
<dd>The value of the <i>how</i> argument is not equal to one of the defined values.</dd>
|
|
</dl>
|
|
|
|
<p><sup>[<a href="javascript:open_code('THR')">THR</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">
|
|
The <i>pthread_sigmask</i>() function shall not return an error code of [EINTR]. <img src="../images/opt-end.gif" alt=
|
|
"[Option End]" border="0"></p>
|
|
</blockquote>
|
|
|
|
<hr>
|
|
<div class="box"><em>The following sections are informative.</em></div>
|
|
|
|
<h4><a name="tag_03_573_06"></a>EXAMPLES</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_07"></a>APPLICATION USAGE</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_08"></a>RATIONALE</h4>
|
|
|
|
<blockquote>
|
|
<p>When a process' signal mask is changed in a signal-catching function that is installed by <a href=
|
|
"../functions/sigaction.html"><i>sigaction</i>()</a>, the restoration of the signal mask on return from the signal-catching
|
|
function overrides that change (see <a href="../functions/sigaction.html"><i>sigaction</i>()</a>). If the signal-catching function
|
|
was installed with <a href="../functions/signal.html"><i>signal</i>()</a>, it is unspecified whether this occurs.</p>
|
|
|
|
<p>See <a href="kill.html"><i>kill</i>()</a> for a discussion of the requirement on delivery of signals.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_09"></a>FUTURE DIRECTIONS</h4>
|
|
|
|
<blockquote>
|
|
<p>None.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_10"></a>SEE ALSO</h4>
|
|
|
|
<blockquote>
|
|
<p><a href="sigaction.html"><i>sigaction</i>()</a> , <a href="sigaddset.html"><i>sigaddset</i>()</a> , <a href=
|
|
"sigdelset.html"><i>sigdelset</i>()</a> , <a href="sigemptyset.html"><i>sigemptyset</i>()</a> , <a href=
|
|
"sigfillset.html"><i>sigfillset</i>()</a> , <a href="sigismember.html"><i>sigismember</i>()</a> , <a href=
|
|
"sigpending.html"><i>sigpending</i>()</a> , <a href="sigqueue.html"><i>sigqueue</i>()</a> , <a href=
|
|
"sigsuspend.html"><i>sigsuspend</i>()</a> , the Base Definitions volume of IEEE Std 1003.1-2001, <a href=
|
|
"../basedefs/signal.h.html"><i><signal.h></i></a></p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_11"></a>CHANGE HISTORY</h4>
|
|
|
|
<blockquote>
|
|
<p>First released in Issue 3. Included for alignment with the POSIX.1-1988 standard.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_12"></a>Issue 5</h4>
|
|
|
|
<blockquote>
|
|
<p>The DESCRIPTION is updated for alignment with the POSIX Threads Extension.</p>
|
|
|
|
<p>The <i>pthread_sigmask</i>() function is added for alignment with the POSIX Threads Extension.</p>
|
|
</blockquote>
|
|
|
|
<h4><a name="tag_03_573_13"></a>Issue 6</h4>
|
|
|
|
<blockquote>
|
|
<p>The <i>pthread_sigmask</i>() function is marked as part of the Threads option.</p>
|
|
|
|
<p>The SYNOPSIS for <i>sigprocmask</i>() is marked as a CX extension to note that the presence of this function in the <a href=
|
|
"../basedefs/signal.h.html"><i><signal.h></i></a> header is an extension to the ISO C standard.</p>
|
|
|
|
<p>The following changes are made for alignment with the ISO POSIX-1:1996 standard:</p>
|
|
|
|
<ul>
|
|
<li>
|
|
<p>The DESCRIPTION is updated to explicitly state the functions which may generate the signal.</p>
|
|
</li>
|
|
</ul>
|
|
|
|
<p>The DESCRIPTION is updated to avoid use of the term "must" for application requirements.</p>
|
|
|
|
<p>The <b>restrict</b> keyword is added to the <i>pthread_sigmask</i>() and <i>sigprocmask</i>() prototypes for alignment with the
|
|
ISO/IEC 9899:1999 standard.</p>
|
|
</blockquote>
|
|
|
|
<div class="box"><em>End of informative text.</em></div>
|
|
|
|
<hr>
|
|
<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>
|
|
|