* POLLRDHUP inconsistency between poll() and epoll
[not found] <Pine.LNX.4.64.0603261624110.15079@alien.or.mcafeemobile.com>
@ 2006-04-04 1:49 ` Michael Kerrisk
2006-04-04 2:14 ` Davide Libenzi
0 siblings, 1 reply; 2+ messages in thread
From: Michael Kerrisk @ 2006-04-04 1:49 UTC (permalink / raw)
To: Davide Libenzi; +Cc: linux-kernel, michael.kerrisk
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'.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: POLLRDHUP inconsistency between poll() and epoll
2006-04-04 1:49 ` POLLRDHUP inconsistency between poll() and epoll Michael Kerrisk
@ 2006-04-04 2:14 ` Davide Libenzi
0 siblings, 0 replies; 2+ messages in thread
From: Davide Libenzi @ 2006-04-04 2:14 UTC (permalink / raw)
To: Michael Kerrisk; +Cc: Linux Kernel Mailing List, michael.kerrisk
On Tue, 4 Apr 2006, Michael Kerrisk wrote:
> 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?
No. It is definitely better to keep behaviour consistent with poll/select.
I'll submit a patch ASAP. Thank you spotting this out!
- Davide
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-04-04 2:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <Pine.LNX.4.64.0603261624110.15079@alien.or.mcafeemobile.com>
2006-04-04 1:49 ` POLLRDHUP inconsistency between poll() and epoll Michael Kerrisk
2006-04-04 2:14 ` Davide Libenzi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®