今天我在将一些代码从select()转移到kqueue(),发现kevent()似乎没有类似于select()中的“exception-set”功能的对应项。
也就是说,select()的函数签名为:
也就是说,select()的函数签名为:
int select(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, fd_set *restrict errorfds, struct timeval *restrict timeout);
...使用kevent()函数,EVFILT_READ对应(readfds),EVFILT_WRITE对应(writefds),但我没有看到任何类似于EVFILT_ERROR的东西来对应(errorfds)。
在kevent()函数中真的没有支持套接字错误条件的功能吗?还是说它确实存在,但以某种对我不明显的方式实现了?