.SH SYNOPSIS
.nf
.B #include <ucontext.h>
-.PP
+.P
.BI "int getcontext(ucontext_t *" ucp );
.BI "int setcontext(const ucontext_t *" ucp );
.fi
.BR swapcontext (3)
that allow user-level context switching between multiple
threads of control within a process.
-.PP
+.P
The
.I mcontext_t
type is machine-dependent and opaque.
.I ucontext_t
type is a structure that has at least
the following fields:
-.PP
+.P
.in +4n
.EX
typedef struct ucontext_t {
} ucontext_t;
.EE
.in
-.PP
+.P
with
.I sigset_t
and
is the
machine-specific representation of the saved context,
that includes the calling thread's machine registers.
-.PP
+.P
The function
.BR getcontext ()
initializes the structure
pointed to by
.I ucp
to the currently active context.
-.PP
+.P
The function
.BR setcontext ()
restores the user context
.B SA_SIGINFO
flag in
.BR sigaction (2)).
-.PP
+.P
If the context was obtained by a call of
.BR getcontext (),
program execution continues as if this call just returned.
-.PP
+.P
If the context was obtained by a call of
.BR makecontext (3),
program execution continues by a call to the function
first argument of that call to
.BR makecontext (3).
When this member is NULL, the thread exits.
-.PP
+.P
If the context was obtained by a call to a signal handler,
then old standard text says that "program execution continues with the
program instruction following the instruction interrupted
None.
.SH HISTORY
SUSv2, POSIX.1-2001.
-.PP
+.P
POSIX.1-2008 removes these functions,
citing portability issues, and
recommending that applications be rewritten to use POSIX threads instead.
call.
The user has to invent their own bookkeeping device, and a register
variable won't do since registers are restored.
-.PP
+.P
When a signal occurs, the current user context is saved and
a new context is created by the kernel for the signal handler.
Do not leave the handler using