📄 setjmp.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html><head><!-- Copyright 1997 The Open Group, All Rights Reserved --><title>setjmp</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_417"> </a>NAME</h4><blockquote>setjmp - set jump point for a non-local goto</blockquote><h4><a name = "tag_000_008_418"> </a>SYNOPSIS</h4><blockquote><pre><code>#include <<a href="setjmp.h.html">setjmp.h</a>>int setjmp(jmp_buf <i>env</i>);</code></pre></blockquote><h4><a name = "tag_000_008_419"> </a>DESCRIPTION</h4><blockquote>A call to<i>setjmp()</i>,saves the calling environment in its<i>env</i>argument for later use by<i><a href="longjmp.html">longjmp()</a></i>.<p>It is unspecified whether<i>setjmp()</i>is a macro or a function.If a macro definition is suppressed in order to access an actualfunction, or a program defines an external identifier with the name<i>setjmp</i>the behaviour is undefined.<p>All accessible objects have values as of the time<i><a href="longjmp.html">longjmp()</a></i>was called, except that the values of objects of automaticstorage duration which are local to the function containing theinvocation of the corresponding<i>setjmp()</i>which do not have volatile-qualified type and which arechanged between the<i>setjmp()</i>invocation and<i><a href="longjmp.html">longjmp()</a></i>call are indeterminate.<p>An invocation of<i>setjmp()</i>must appear in one of the following contexts only:<ul><p><li>the entire controlling expression of a selection or iterationstatement<p><li>one operand of a relational or equality operator with the otheroperand an integral constant expression, with the resultingexpression being the entire controlling expression of a selectionor iteration statement<p><li>the operand of a unary "!"operator with the resulting expressionbeing the entire controlling expression of a selection oriteration<p><li>the entire expression of an expression statement (possibly castto<b>void</b>).<p></ul></blockquote><h4><a name = "tag_000_008_420"> </a>RETURN VALUE</h4><blockquote>If the return is from a direct invocation,<i>setjmp()</i>returns 0. If the return is from a call to<i><a href="longjmp.html">longjmp()</a></i>,<i>setjmp()</i>returns a non-zero value.</blockquote><h4><a name = "tag_000_008_421"> </a>ERRORS</h4><blockquote>No errors are defined.</blockquote><h4><a name = "tag_000_008_422"> </a>EXAMPLES</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_423"> </a>APPLICATION USAGE</h4><blockquote>In general,<i><a href="sigsetjmp.html">sigsetjmp()</a></i>is more useful in dealing with errors and interruptsencountered in a low-level subroutine of a program.</blockquote><h4><a name = "tag_000_008_424"> </a>FUTURE DIRECTIONS</h4><blockquote>None.</blockquote><h4><a name = "tag_000_008_425"> </a>SEE ALSO</h4><blockquote><i><a href="longjmp.html">longjmp()</a></i>,<i><a href="sigsetjmp.html">sigsetjmp()</a></i>,<i><a href="setjmp.h.html"><setjmp.h></a></i>.</blockquote><h4>DERIVATION</h4><blockquote>Derived from Issue 1 of the SVID.</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 + -