ANSI C compatible event loop

2019-09-21 05:13发布

Is there an ANSI-C compatible event loop, like libev or libevent? My requirement is to compile with -ansi flag.

Thank you.

1条回答
家丑人穷心不美
2楼-- · 2019-09-21 05:55

You cannot have any strictly ANSI compatible event loop on Linux, because the purpose of an event loop is to multiplex cleverly several inputs; on Linux to do that multiplexing, you have to call some syscalls like poll(2), pselect(2) or friends, and all these syscalls are not standardized in ANSI C (or ISO C99, or ISO C2011), but just in Posix.

登录 后发表回答