Manual Reference Pages - UNW_GETCONTEXT (3)
-- get initial machine-state
Thread And Signal Safety
routine initializes the context structure
pointed to by ucp
with the machine-state of the call-site. The
exact set of registers stored by unw_getcontext()
platform-specific, but, in general, at least all preserved
(callee-saved) and all frame-related registers, such as the
stack-pointer, will be stored.
This routine is normally implemented as a macro and applications
should not attempt to take its address.
On IA-64, unw_context_t
has a layout that is compatible with
that of ucontext_t
and such structures can be initialized with
instead of unw_getcontext().
reverse is not
true and it is not
safe to use structures
initialized by unw_getcontext()
in places where a structure
initialized by getcontext()
is expected. The reason for this
asymmetry is that unw_getcontext()
is optimized for maximum
performance and does not, for example, save the signal mask.
On successful completion, unw_getcontext()
Otherwise, a value of -1 is returned.
THREAD AND SIGNAL SAFETY
is thread-safe as well as safe to use
from a signal handler.
|Programming Library ||UNW\_GETCONTEXT (3) ||16 August 2007 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.