|
NAMEgetcontext , getcontextx ,
setcontext —
get and set user thread context
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <ucontext.h>
int
ucontext_t *
int
DESCRIPTIONThegetcontext () function saves the current thread's
execution context in the structure pointed to by ucp.
This saved context may then later be restored by calling
setcontext ().
The The If ucp was initialized by
If ucp was initialized by
makecontext(3),
execution continues with the invocation of the function specified to
makecontext(3).
When that function returns, ucp->uc_link determines
what happens next: if ucp->uc_link is
If ucp was initialized by the invocation of a signal handler, execution continues at the point the thread was interrupted by the signal. RETURN VALUESIf successful,getcontext () returns zero and
setcontext () does not return; otherwise -1 is
returned. The getcontextx () returns pointer to the
allocated and initialized context on success, and NULL
on failure.
ERRORSNo errors are defined forgetcontext () or
setcontext (). The
getcontextx () may return the following errors in
errno:
SEE ALSOsigaction(2), sigaltstack(2), makecontext(3), ucontext(3)STANDARDSThegetcontext () and
setcontext () functions conform to
X/Open System Interfaces and Headers Issue 5
(“XSH5”) and IEEE Std 1003.1-2001
(“POSIX.1”). The errno indications
are an extension to the standard.
The IEEE Std 1003.1-2004
(“POSIX.1”) revision marked the functions
HISTORYThegetcontext () and
setcontext () functions first appeared in
AT&T System V Release 4 UNIX.
Visit the GSP FreeBSD Man Page Interface. |