File:  [DVB] / dietlibc / lib / swapcontext.c
Revision 1.1: download - view: text, annotated - select for diffs
Fri Oct 10 18:23:27 2014 UTC (9 years, 7 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
  add getcontext, setcontext, makecontext, swapcontext (i386 and x86_64 only for now)

#include <ucontext.h>
#include <stdio.h>

int swapcontext(ucontext_t* o,const ucontext_t* n) {
  volatile int once=0;
  if (getcontext(o)==-1) return -1;
  if (!once) {
    ++once;
    return setcontext(n);
  }
  return 0;
}

LinuxTV legacy CVS <linuxtv.org/cvs>