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