Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why was ucontext added to and then removed from POSIX?

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?

like image 943
eonil Avatar asked Oct 16 '25 04:10

eonil


1 Answers

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).

like image 163
Yu Hao Avatar answered Oct 17 '25 18:10

Yu Hao



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!