blob: c13860bbc59186ce7ae9df2ee074ac415cc666f9 [file] [log] [blame]
mostang.com!davidm9eb9f312003-04-01 07:19:34 +00001'\" t
mostang.com!davidm031c8bb2004-03-31 00:52:17 +00002.\" Manual page created with latex2man on Tue Mar 30 16:50:17 PST 2004
mostang.com!davidm9eb9f312003-04-01 07:19:34 +00003.\" 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..
mostang.com!davidm031c8bb2004-03-31 00:52:17 +000013.TH "UNW\\_GETCONTEXT" "3" "30 March 2004" "Programming Library " "Programming Library "
mostang.com!davidm9eb9f312003-04-01 07:19:34 +000014.SH NAME
15unw_getcontext
16\-\- get initial machine\-state
17.PP
18.SH SYNOPSIS
19
20.PP
21#include <libunwind.h>
22.br
23.PP
24int
25unw_getcontext(unw_context_t *ucp);
26.br
27.PP
28.SH DESCRIPTION
29
30.PP
31The unw_getcontext()
32routine initializes the context structure
33pointed to by ucp
34with the machine\-state of the call\-site. The
35exact set of registers stored by unw_getcontext()
36is
37platform\-specific, but, in general, at least all preserved
38(``callee\-saved\&'') and all frame\-related registers, such as the
39stack\-pointer, will be stored.
40.PP
mostang.com!davidmf928eec2004-01-21 01:05:07 +000041This routine is normally implemented as a macro and applications
42should not attempt to take its address.
43.PP
mostang.com!davidm031c8bb2004-03-31 00:52:17 +000044.SH PLATFORM\-SPECIFIC NOTES
45
46.PP
47On IA\-64, unw_context_t
48has a layout that is compatible with
49that of ucontext_t
50and such structures can be initialized with
51getcontext()
52instead of unw_getcontext().
53However, the
54reverse is \fInot\fP
55true and it is \fInot\fP
56safe to use structures
57initialized by unw_getcontext()
58in places where a structure
59initialized by getcontext()
60is expected. The reason for this
61asymmetry is that unw_getcontext()
62is optimized for maximum
63performance and does not, for example, save the signal mask.
64.PP
mostang.com!davidm9eb9f312003-04-01 07:19:34 +000065.SH RETURN VALUE
66
67.PP
68On successful completion, unw_getcontext()
69returns 0.
70Otherwise, a value of \-1 is returned.
71.PP
72.SH THREAD AND SIGNAL SAFETY
73
74.PP
75unw_getcontext()
76is thread\-safe as well as safe to use
77from a signal handler.
78.PP
79.SH SEE ALSO
80
81.PP
82libunwind(3),
83unw_init_local(3)
84.PP
85.SH AUTHOR
86
87.PP
88David Mosberger\-Tang
89.br
90Hewlett\-Packard Labs
91.br
92Palo\-Alto, CA 94304
93.br
94Email: \fBdavidm@hpl.hp.com\fP
95.br
96WWW: \fBhttp://www.hpl.hp.com/research/linux/libunwind/\fP\&.
97.\" NOTE: This file is generated, DO NOT EDIT.