Re: Is POLLHUP an input-only or bidirectional condition? (was: epoll reporting events when it hasn't been asked to)

Davide Libenzi
2004-04-04T19:40:59Z

On Sun, 4 Apr 2004, Ben Mansell wrote:

> With epoll, adding a fd into the epoll set is a separate operation from
> the epoll_wait(), so if you really don't want to listen for any events
> on one FD, you'll have to do a EPOLL_DEL, and then later on do a
> EPOLL_ADD again if you want to bring it back in. Which is a bit nasty
> and inefficient.

I really fail to see how handling POLLHUP and POLLERR would be a problem,
even for fds where you specified a 0 event mask. If you receive them, you
remove the fd from the set, and you flag the associated data structure for
a lazy removal at the end of the current event loop. Where is the problem
here?

- Davide