libunwind-setjmp.man 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. '\" t
  2. .\" Manual page created with latex2man on Thu Aug 16 09:44:44 MDT 2007
  3. .\" NOTE: This file is generated, DO NOT EDIT.
  4. .de Vb
  5. .ft CW
  6. .nf
  7. ..
  8. .de Ve
  9. .ft R
  10. .fi
  11. ..
  12. .TH "LIBUNWIND\-SETJMP" "3" "16 August 2007" "Programming Library " "Programming Library "
  13. .SH NAME
  14. libunwind\-setjmp
  15. \-\- libunwind\-based non\-local gotos
  16. .PP
  17. .SH SYNOPSIS
  18. .PP
  19. #include <setjmp.h>
  20. .br
  21. .PP
  22. int
  23. setjmp(jmp_buf env);
  24. .br
  25. void
  26. longjmp(jmp_buf env,
  27. int val);
  28. .br
  29. int
  30. _setjmp(jmp_buf env);
  31. .br
  32. void
  33. _longjmp(jmp_buf env,
  34. int val);
  35. .br
  36. int
  37. setjmp(sigjmp_buf env,
  38. int savemask);
  39. .br
  40. void
  41. siglongjmp(sigjmp_buf env,
  42. int val);
  43. .br
  44. .PP
  45. .SH DESCRIPTION
  46. .PP
  47. The unwind\-setjmp
  48. library offers a libunwind\-based
  49. implementation of non\-local gotos. This implementation is intended to
  50. be a drop\-in replacement for the normal, system\-provided routines of
  51. the same name. The main advantage of using the unwind\-setjmp
  52. library is that setting up a non\-local goto via one of the
  53. setjmp()
  54. routines is very fast. Typically, just 2 or 3 words
  55. need to be saved in the jump\-buffer (plus one call to
  56. sigprocmask(2),
  57. in the case of sigsetjmp).
  58. On the
  59. other hand, executing a non\-local goto by calling one of the
  60. longjmp()
  61. routines tends to be much slower than with the
  62. system\-provided routines. In fact, the time spent on a
  63. longjmp()
  64. will be proportional to the number of call frames
  65. that exist between the points where setjmp()
  66. and
  67. longjmp()
  68. were called. For this reason, the
  69. unwind\-setjmp
  70. library is beneficial primarily in applications
  71. that frequently call setjmp()
  72. but only rarely call
  73. longjmp().
  74. .PP
  75. .SH CAVEATS
  76. .PP
  77. .TP
  78. .B *
  79. The correct operation of this library depends on the presence of
  80. correct unwind information. On newer platforms, this is rarely an
  81. issue. On older platforms, care needs to be taken to
  82. ensure that each of the functions whose stack frames may have to be
  83. unwound during a longjmp()
  84. have correct unwind information
  85. (on those platforms, there is usually a compiler\-switch, such as
  86. \fB\-funwind\-tables\fP,
  87. to request the generation of unwind
  88. information).
  89. .TP
  90. .B *
  91. The contents of jmp_buf and sigjmp_buf as setup
  92. and used by these routines is completely different from the ones
  93. used by the system\-provided routines. Thus, a jump\-buffer created
  94. by the libunwind\-based setjmp()/_setjmp
  95. may only be
  96. used in a call to the libunwind\-based
  97. longjmp()/_longjmp().
  98. The analogous applies for
  99. sigjmp_buf
  100. with sigsetjmp()
  101. and siglongjmp().
  102. .PP
  103. .SH FILES
  104. .PP
  105. .TP
  106. \fB\-l\fPunwind\-setjmp
  107. The library an application should
  108. be linked against to ensure it uses the libunwind\-based non\-local
  109. goto routines.
  110. .PP
  111. .SH SEE ALSO
  112. .PP
  113. libunwind(3),
  114. setjmp(3), longjmp(3),
  115. _setjmp(3), _longjmp(3),
  116. sigsetjmp(3), siglongjmp(3)
  117. .PP
  118. .SH AUTHOR
  119. .PP
  120. David Mosberger\-Tang
  121. .br
  122. Email: \fBdmosberger@gmail.com\fP
  123. .br
  124. WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
  125. .\" NOTE: This file is generated, DO NOT EDIT.