As far as I know, ucontext
offers something better then setjmp
. But it's deprecated and now removed from the POSIX spec. So why did it appear and why was it removed?
The signature of makecontext
from ucontext.h
is:
void makecontext(ucontext_t *ucp, void (*func)(),
int argc, ...);
Note that func
uses an empty parenthesis as argument, but this is a deprecated feature in standard C:
C11(ISO/IEC 9899:201x) §6.11.6 Function declarators
The use of function declarators with empty parentheses (not prototype-format parameter type declarators) is an obsolescent feature.
This is the reason it's deprecated (and somehow unfortunate).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With