ANSI C compatible event loop

时间秒杀一切 提交于 2019-12-13 11:04:24

问题


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

Thank you.


回答1:


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.



来源:https://stackoverflow.com/questions/13433379/ansi-c-compatible-event-loop

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!