*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> makecontext (3)              



NAME    [Toc]    [Back]

     makecontext, swapcontext -- modify and exchange user thread contexts

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #include <ucontext.h>

     makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...);

     swapcontext(ucontext_t *oucp, const ucontext_t *ucp);

DESCRIPTION    [Toc]    [Back]

     The makecontext() 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 provided to makecontext() and also equal to the number of arguments
 to func(), or else the behavior is undefined.

     The ucp->uc_link argument must be initialized before calling
     makecontext() and determines the action to take when func() returns: if
     equal to NULL, the process exits; otherwise, setcontext(ucp->uc_link) is
     implicitly invoked.

     The swapcontext() function saves the current thread context in *oucp and
     makes *ucp the currently active context.

RETURN VALUES    [Toc]    [Back]

     If successful, swapcontext() returns zero; otherwise -1 is returned and
     the global variable errno is set appropriately.

ERRORS    [Toc]    [Back]

     The swapcontext() function will fail if:

     [ENOMEM]		There is not enough stack space in ucp to complete the

SEE ALSO    [Toc]    [Back]

     setcontext(3), ucontext(3)

FreeBSD 5.2.1		      September 10, 2002		 FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
swapcontext HP-UX manipulate user contexts
makecontext HP-UX manipulate user contexts
makecontext IRIX manipulate user contexts
gss_add_cred Tru64 Obtain credentials that allow a user to accept security contexts.
usermod Linux Modify a user account
activinit OpenBSD modify or add user in ActivCard, CRYPTOCard,
usermod HP-UX modify a user login on the system
snkinit OpenBSD modify or add user in ActivCard, CRYPTOCard,
usermod OpenBSD modify user login information
modifyUserAccount IRIX modify an existing user account
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service