Is there an equivalent to kqueue () / kevent () for select () "errorfds"?

I was porting some code from select () to kqueue () today, and I noticed that kevent () did not seem to have an analogue for the select () function "exception-set".

That is, function () function-signature:

int select(int nfds, fd_set *restrict readfds, fd_set *restrict writefds, fd_set *restrict errorfds, struct timeval *restrict timeout); 

... and with kevent (), EVFILT_READ matches (readfds), and EVFILT_WRITE matches (writefds), but I don't see anything like EVFILT_ERROR that matches (errorfds).

Is there really no support for socket error conditions in kevent (), or is it there, but implemented in some way, which is not obvious to me?

+4
source share
1 answer

Unable to filter this way. You must manually classify incoming events based on flags (EV_EOF) and fflags.

0
source

Source: https://habr.com/ru/post/1387137/


All Articles