Back to index

glibc  2.9
Functions
swapcontext.c File Reference
#include <ucontext.h>

Go to the source code of this file.

Functions

int __getcontext (ucontext_t *ucp)
int __setcontext (const ucontext_t *ucp)
int __swapcontext (ucontext_t *oucp, const ucontext_t *ucp)

Function Documentation

Here is the caller graph for this function:

Here is the caller graph for this function:

int __swapcontext ( ucontext_t oucp,
const ucontext_t ucp 
)

Definition at line 27 of file swapcontext.c.

{
  /* Save the current machine context to oucp.  */
  __getcontext (oucp);

  /* mark sc_sar flag to skip the setcontext call on reactivation.  */
  if (oucp->uc_mcontext.sc_sar == 0) {
       oucp->uc_mcontext.sc_sar++;

       /* Restore the machine context in ucp.  */
       __setcontext (ucp);
  }

  return 0;
}

Here is the call graph for this function: