Jer*_*ner 5 error-handling select kqueue
今天我将一些代码从 select() 移植到 kqueue(),我注意到 kevent() 似乎没有 select() 的“异常设置”功能的模拟。
也就是说,select()的函数签名是:
int select(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, fd_set *restrict errorfds, struct timeval *restrict timeout);
Run Code Online (Sandbox Code Playgroud)
...对于 kevent(),EVFILT_READ 对应于 (readfds),EVFILT_WRITE 对应于 (writefds),但我没有看到任何像 EVFILT_ERROR 对应于 (errorfds) 的内容。
kevent() 下是否真的不支持套接字错误条件,或者是否存在但以某种对我来说不明显的方式实现?