我正在修改一个应用程序,以便用 kqueue 替换它对 select() 的使用。select() 允许轮询异常情况:
int select(int nfds,
fd_set *restrict readfds,
fd_set *restrict writefds,
fd_set *restrict errorfds, <---- this thing here
struct timeval *restrict timeout
);
阅读 kqueue 文档后,似乎没有办法做到这一点。有EVFILT_READ但EVFILT_WRITE没有类似EVFILT_ERROR/的内容EVFILT_EXCEPTIONAL。是否可以轮询异常情况,如果可以,如何进行?