Subroutine Purpose Modifies the context specified by ucp . When this context is resumed using swapcontext subroutine or setcontext subroutine, program execution continues by calling func parameter, passing it the arguments that follow argc in the makecontext subroutine. Before a call is made to makecontext subroutine, the context being modified should have a stack allocated for it. The value of argc must match the number of integer argument passed to func parameter, otherwise the behavior is undefined. The swapcontext subroutine function saves the current context in the context structure pointed to by oucp parameter and sets the context to the context structure pointed to by ucp .
Parameters ucp A pointer to a user structure.
The number of arguments being passed to func parameter. On successful completion, swapcontext subroutine returns 0. Otherwise, a value of -1 is returned and errno is set to indicate the error. Not successful and the errno global variable is set to one of the following error codes. The ucp argument does not have enough stack left to complete the operation.