Files
2024-02-19 00:21:47 -05:00

175 lines
7.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>sigsetjmp</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="sigsetjmp"></a> <a name="tag_03_697"></a><!-- sigsetjmp -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_03_697_01"></a>NAME</h4>
<blockquote>sigsetjmp - set jump point for a non-local goto</blockquote>
<h4><a name="tag_03_697_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<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"> #include &lt;<a href="../basedefs/setjmp.h.html">setjmp.h</a>&gt;<br>
<br>
int sigsetjmp(sigjmp_buf</tt> <i>env</i><tt>, int</tt> <i>savemask</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_697_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>sigsetjmp</i>() function shall be equivalent to the <a href="../functions/setjmp.html"><i>setjmp</i>()</a> function,
except as follows:</p>
<ul>
<li>
<p>References to <a href="../functions/setjmp.html"><i>setjmp</i>()</a> are equivalent to <i>sigsetjmp</i>().</p>
</li>
<li>
<p>References to <a href="../functions/longjmp.html"><i>longjmp</i>()</a> are equivalent to <a href=
"../functions/siglongjmp.html"><i>siglongjmp</i>()</a>.</p>
</li>
<li>
<p>If the value of the <i>savemask</i> argument is not 0, <i>sigsetjmp</i>() shall also save the current signal mask of the calling
thread as part of the calling environment.</p>
</li>
</ul>
</blockquote>
<h4><a name="tag_03_697_04"></a>RETURN VALUE</h4>
<blockquote>
<p>If the return is from a successful direct invocation, <i>sigsetjmp</i>() shall return 0. If the return is from a call to <a
href="../functions/siglongjmp.html"><i>siglongjmp</i>()</a>, <i>sigsetjmp</i>() shall return a non-zero value.</p>
</blockquote>
<h4><a name="tag_03_697_05"></a>ERRORS</h4>
<blockquote>
<p>No errors are defined.</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_03_697_06"></a>EXAMPLES</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_697_07"></a>APPLICATION USAGE</h4>
<blockquote>
<p>The distinction between <a href="../functions/setjmp.html"><i>setjmp</i>()</a>/ <a href=
"../functions/longjmp.html"><i>longjmp</i>()</a> and <i>sigsetjmp</i>()/ <a href=
"../functions/siglongjmp.html"><i>siglongjmp</i>()</a> is only significant for programs which use <a href=
"../functions/sigaction.html"><i>sigaction</i>()</a>, <a href="../functions/sigprocmask.html"><i>sigprocmask</i>()</a>, or <a href=
"../functions/sigsuspend.html"><i>sigsuspend</i>()</a>.</p>
<p>Note that since this function is defined in terms of <a href="../functions/setjmp.html"><i>setjmp</i>()</a>, if <i>savemask</i>
is zero, it is unspecified whether the signal mask is saved.</p>
</blockquote>
<h4><a name="tag_03_697_08"></a>RATIONALE</h4>
<blockquote>
<p>The ISO&nbsp;C standard specifies various restrictions on the usage of the <a href=
"../functions/setjmp.html"><i>setjmp</i>()</a> macro in order to permit implementors to recognize the name in the compiler and not
implement an actual function. These same restrictions apply to the <i>sigsetjmp</i>() macro.</p>
<p>There are processors that cannot easily support these calls, but this was not considered a sufficient reason to exclude
them.</p>
<p>4.2 BSD, 4.3 BSD, and XSI-conformant systems provide functions named <a href="../functions/_setjmp.html"><i>_setjmp</i>()</a>
and <a href="../functions/_longjmp.html"><i>_longjmp</i>()</a> that, together with <a href=
"../functions/setjmp.html"><i>setjmp</i>()</a> and <a href="../functions/longjmp.html"><i>longjmp</i>()</a>, provide the same
functionality as <i>sigsetjmp</i>() and <a href="../functions/siglongjmp.html"><i>siglongjmp</i>()</a>. On those systems, <a href=
"../functions/setjmp.html"><i>setjmp</i>()</a> and <a href="../functions/longjmp.html"><i>longjmp</i>()</a> save and restore signal
masks, while <a href="../functions/_setjmp.html"><i>_setjmp</i>()</a> and <a href=
"../functions/_longjmp.html"><i>_longjmp</i>()</a> do not. On System V Release 3 and in corresponding issues of the SVID, <a href=
"../functions/setjmp.html"><i>setjmp</i>()</a> and <a href="../functions/longjmp.html"><i>longjmp</i>()</a> are explicitly defined
not to save and restore signal masks. In order to permit existing practice in both cases, the relation of <a href=
"../functions/setjmp.html"><i>setjmp</i>()</a> and <a href="../functions/longjmp.html"><i>longjmp</i>()</a> to signal masks is not
specified, and a new set of functions is defined instead.</p>
<p>The <a href="../functions/longjmp.html"><i>longjmp</i>()</a> and <a href="../functions/siglongjmp.html"><i>siglongjmp</i>()</a>
functions operate as in the previous issue provided the matching <a href="../functions/setjmp.html"><i>setjmp</i>()</a> or
<i>sigsetjmp</i>() has been performed in the same thread. Non-local jumps into contexts saved by other threads would be at best a
questionable practice and were not considered worthy of standardization.</p>
</blockquote>
<h4><a name="tag_03_697_09"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_03_697_10"></a>SEE ALSO</h4>
<blockquote>
<p><a href="siglongjmp.html"><i>siglongjmp</i>()</a> , <a href="signal.html"><i>signal</i>()</a> , <a href=
"sigprocmask.html"><i>sigprocmask</i>()</a> , <a href="sigsuspend.html"><i>sigsuspend</i>()</a> , the Base Definitions volume of
IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../basedefs/setjmp.h.html"><i>&lt;setjmp.h&gt;</i></a></p>
</blockquote>
<h4><a name="tag_03_697_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_697_12"></a>Issue 5</h4>
<blockquote>
<p>The DESCRIPTION is updated for alignment with the POSIX Threads Extension.</p>
</blockquote>
<h4><a name="tag_03_697_13"></a>Issue 6</h4>
<blockquote>
<p>The DESCRIPTION is reworded in terms of <a href="../functions/setjmp.html"><i>setjmp</i>()</a>.</p>
<p>The SYNOPSIS is marked CX since the presence of this function in the <a href=
"../basedefs/setjmp.h.html"><i>&lt;setjmp.h&gt;</i></a> header is an extension over the ISO&nbsp;C 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 &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; 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>