setjmp.html 1020 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <html>
  2. <head>
  3. <title>setjmp</title>
  4. <body bgcolor=#ffffff>
  5. <h2 align=center>setjmp</h2>
  6. <h4 align=center>OS/161 Reference Manual</h4>
  7. <h3>Name</h3>
  8. setjmp, longjmp - non-local jump operations
  9. <h3>Library</h3>
  10. Standard C Library (libc, -lc)
  11. <h3>Synopsis</h3>
  12. #include &lt;setjmp.h&gt;<br>
  13. <br>
  14. int<br>
  15. setjmp(jmp_buf <em>jb</em>);<br>
  16. <br>
  17. void<br>
  18. longjmp(jmp_buf <em>jb</em>, int <em>returncode</em>);<br>
  19. <h3>Description</h3>
  20. setjmp saves the current stack frame and processor state in
  21. <em>jb</em>. A subsequent call to longjmp with the same <em>jb</em>
  22. causes execution to jump to where setjmp was called from.
  23. <p>
  24. If the stack frame that called setjmp returns before longjmp is
  25. called, the results are undefined.
  26. <p>
  27. <h3>Return Values</h3>
  28. When called, setjmp returns 0. When longjmp is called, it does not
  29. itself return, but instead causes setjmp to appear to return again,
  30. this time returning <em>returncode</em>.
  31. <p>
  32. If zero is passed <em>returncode</em>, it is forced to 1 instead.
  33. <p>
  34. </body>
  35. </html>