Return to swapcontext.c CVS log | Up to [DVB] / dietlibc / lib |
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; }