5

I was porting some code from select() to kqueue() today, and I noticed that kevent() doesn't seem to have an analog for select()'s "exception-set" feature.

That is to say, select()'s function-signature is:

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 corresponds to (readfds), and EVFILT_WRITE corresponds to (writefds), but I don't see anything like EVFILT_ERROR that would correspond to (errorfds).

Is there really just no support for socket-error-conditions under kevent(), or is it there but implemented in some way that isn't obvious to me?

Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
  • What do you need errorfds for? Read errors are already reported through read events, and write errors are through write events (by the resulting read or write failing). – Ambroz Bizjak Dec 27 '11 at 16:58

1 Answers1

0

It's not possible to filter in that way. You must manually classify incoming events based on flags (EV_EOF) and fflags.

Ismael Luceno
  • 2,055
  • 15
  • 26