swapcontext(3C) DG/UX 5.4.2 swapcontext(3C)
NAME
swapcontext - manipulate user contexts
SYNOPSIS
#include <ucontext.h>
int swapcontext (ucontextt *oucp, ucontextt *ucp);
DESCRIPTION
This function is useful for implementing user-level context switching
between multiple threads of control within a process.
swapcontext saves the current context in the context structure
pointed to by oucp and sets the context to the context structure
pointed to by ucp.
This function will fail if either of the following is true:
ENOMEM ucp does not have enough stack left to complete the
operation.
EFAULT ucp or oucp points to an invalid address.
SEE ALSO
exit(2), getcontext(2), sigaction(2), sigprocmask(2), ucontext(5).
DIAGNOSTICS
On successful completion, swapcontext returns a value of zero.
Otherwise, a value of -1 is returned and errno is set to indicate the
error.
NOTES
The size of the ucontextt structure may change in future releases.
To remain binary compatible, users must always use getcontext to
create new instances of them.
Licensed material--property of copyright holder(s) 1