GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MAKECONTEXT (3)

NAME

makecontext, swapcontext - modify and exchange user thread contexts

CONTENTS

Library
Synopsis
Description
Return Values
Errors
See Also

LIBRARY


.Lb libc

SYNOPSIS


.In ucontext.h void
.Fo makecontext ucontext_t *ucp void lp]*funcrp]lp]voidrp] int argc ...
.Fc int swapcontext ucontext_t *oucp const ucontext_t *ucp

DESCRIPTION

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

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

ERRORS

The swapcontext function will fail if:
[ENOMEM]
  There is not enough stack space in ucp to complete the operation.

SEE ALSO

setcontext(3), ucontext(3)
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.