ANSI C兼容事件循环 [英] ANSI C compatible event loop
本文介绍了ANSI C兼容事件循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一个ANSI-C兼容事件循环,像libev或libevent的?我的要求是通过-ansi标志进行编译。
Is there an ANSI-C compatible event loop, like libev or libevent? My requirement is to compile with -ansi flag.
感谢您。
推荐答案
您不能在Linux上的任何严格ANSI兼容事件循环,因为一个事件循环的目的是为了巧妙地复用多个输入;在Linux上做复用,你的有无以的调用一些系统调用一样的民意调查(2),的 PSELECT(2)或朋友,而所有这些系统调用不是在ANSI C(或ISO C99或ISO C2011),但只是Posix的。
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.
这篇关于ANSI C兼容事件循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文