GETCONTEXT(2) | System Calls Manual | GETCONTEXT(2) |
int
getcontext(ucontext_t *ucp);
int
setcontext(const ucontext_t *ucp);
The setcontext() function restores the user context defined in the object pointed to by ucp as most recently initialized by a previous call to either getcontext() or makecontext(3). If successful, execution of the program resumes as defined in the ucp argument, and setcontext() will not return. If ucp was initialized by the getcontext() function, program execution continues as if the corresponding invocation of getcontext() had just returned (successfully). If ucp was initialized by the makecontext(3) function, program execution continues with the function (and function arguments) passed to makecontext(3).
The setcontext() function will fail if:
The IEEE Std 1003.1-2004 (“POSIX.1”) revision marked the functions getcontext() and setcontext() as obsolete, citing portability issues and recommending the use of POSIX threads instead. The IEEE Std 1003.1-2008 (“POSIX.1”) revision removed the functions from the specification.
April 28, 2010 | NetBSD 6.1 |