POLLRDHUP inconsistency between poll() and epoll

From: Michael Kerrisk
Date: Mon Apr 03 2006 - 21:50:27 EST


Davide,

While playing about with the new POLLRDHUP flag, I've noticed
an inconsistency, which may or may not be intentional...

When a POLLRDHUP condition occurs, epoll_wait() tells us about
the condition, regardless of whether or not we specified
(E)POLLRDHUPP in the 'events' flag given to epoll_ctl()
EPOLL_CTL_ADD. In this respect, POLLRDHUP is treated just like
POLLHUP and POLLERR. This seems perfectly reasonable.

By contrast, poll() will only tell us that POLLRDHUP occurred
if we specified POLLRDHUP in the file descriptor 'events' mask
given to the poll() call. In other words, poll() treats
POLLRDHUP differently from POLLHUP and POLLERR. This seems
a little strange.

Is this difference really intended? If it is, what is the
reason for the difference?

Cheers,

Michael

--
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7

Want to help with man page maintenance?
Grab the latest tarball at
ftp://ftp.win.tue.nl/pub/linux-local/manpages/,
read the HOWTOHELP file and grep the source
files for 'FIXME'.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/