|
NAMEmakecontext , swapcontext
—
modify and exchange user thread contexts
LIBRARYStandard C Library (libc, -lc)SYNOPSIS#include <ucontext.h>
void
int
DESCRIPTIONThemakecontext () function modifies the user thread
context pointed to by ucp, which must have previously
been initialized by a call to
getcontext(3)
and had a stack allocated for it. The context is modified so that it will
continue execution by invoking func () with the
arguments provided. The argc argument must be equal to
the number of additional arguments of type int provided
to makecontext () and also equal to the number of
arguments of type int to func ();
otherwise , the behavior is undefined.
The ucp->uc_link argument must be
initialized before calling The RETURN VALUESIf successful,swapcontext () returns zero; otherwise -1
is returned and the global variable errno is set
appropriately.
ERRORSTheswapcontext () function will fail if:
SEE ALSOsetcontext(3), ucontext(3)STANDARDSThemakecontext () and
swapcontext () functions conform to
X/Open System Interfaces and Headers Issue 5
(“XSH5”) and IEEE Std 1003.1-2001
(“POSIX.1”).
The IEEE Std 1003.1-2004
(“POSIX.1”) revision marked the functions
The standard does not clearly define the type of integer
arguments passed to func via
makecontext (); portable applications should not rely
on the implementation detail that it may be possible to pass pointer arguments
to functions.HISTORYThemakecontext () and
swapcontext () functions first appeared in
AT&T System V Release 4 UNIX.
Visit the GSP FreeBSD Man Page Interface. |