All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] uniform POLLRDHUP handling between epoll and poll/select ...
@ 2006-04-04  3:15 Davide Libenzi
  2006-04-04  3:31 ` Michael Kerrisk
  0 siblings, 1 reply; 3+ messages in thread
From: Davide Libenzi @ 2006-04-04  3:15 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton, Michael Kerrisk, michael.kerrisk


Like reported by Michael Kerrisk, POLLRDHUP handling was not consistent 
between epoll and poll/select, since in epoll it was unmaskeable. This 
patch brings uniformity in POLLRDHUP handling.



Signed-off-by: Davide Libenzi <davidel@xmailserver.org>


- Davide



diff -Nru linux-2.6.16/fs/eventpoll.c linux-2.6.16.mod/fs/eventpoll.c
--- linux-2.6.16/fs/eventpoll.c	2006-04-03 20:08:23.000000000 -0700
+++ linux-2.6.16.mod/fs/eventpoll.c	2006-04-03 20:09:51.000000000 -0700
@@ -599,7 +599,7 @@
  	switch (op) {
  	case EPOLL_CTL_ADD:
  		if (!epi) {
-			epds.events |= POLLERR | POLLHUP | POLLRDHUP;
+			epds.events |= POLLERR | POLLHUP;

  			error = ep_insert(ep, &epds, tfile, fd);
  		} else
@@ -613,7 +613,7 @@
  		break;
  	case EPOLL_CTL_MOD:
  		if (epi) {
-			epds.events |= POLLERR | POLLHUP | POLLRDHUP;
+			epds.events |= POLLERR | POLLHUP;
  			error = ep_modify(ep, epi, &epds);
  		} else
  			error = -ENOENT;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] uniform POLLRDHUP handling between epoll and poll/select ...
  2006-04-04  3:15 [patch] uniform POLLRDHUP handling between epoll and poll/select Davide Libenzi
@ 2006-04-04  3:31 ` Michael Kerrisk
  2006-04-04  3:37   ` Davide Libenzi
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk @ 2006-04-04  3:31 UTC (permalink / raw)
  To: Davide Libenzi; +Cc: linux-kernel, akpm, michael.kerrisk

Davide,

> Like reported by Michael Kerrisk, POLLRDHUP handling was not consistent 
> between epoll and poll/select, since in epoll it was unmaskeable. This 
> patch brings uniformity in POLLRDHUP handling.
[...]
> diff -Nru linux-2.6.16/fs/eventpoll.c linux-2.6.16.mod/fs/eventpoll.c
> --- linux-2.6.16/fs/eventpoll.c	2006-04-03 20:08:23.000000000 -0700
> +++ linux-2.6.16.mod/fs/eventpoll.c	2006-04-03 20:09:51.000000000 -0700
> @@ -599,7 +599,7 @@
>   	switch (op) {
>   	case EPOLL_CTL_ADD:
>   		if (!epi) {
> -			epds.events |= POLLERR | POLLHUP | POLLRDHUP;
> +			epds.events |= POLLERR | POLLHUP;
> 
>   			error = ep_insert(ep, &epds, tfile, fd);
>   		} else
> @@ -613,7 +613,7 @@
>   		break;
>   	case EPOLL_CTL_MOD:
>   		if (epi) {
> -			epds.events |= POLLERR | POLLHUP | POLLRDHUP;
> +			epds.events |= POLLERR | POLLHUP;
>   			error = ep_modify(ep, epi, &epds);
>   		} else
>   			error = -ENOENT;

This makes things consistent -- but in the opposite way
from what I thought they might be.  (The alternative would of 
course have been to make POLLRDHUP un-maskable in both epoll 
and poll().)

So I'm curious: what is the rationale for making POLLRDHUP 
maskable when POLLHUP is not?   Is it an issue of ABI 
compatibility; or something else?

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] 3+ messages in thread

* Re: [patch] uniform POLLRDHUP handling between epoll and poll/select ...
  2006-04-04  3:31 ` Michael Kerrisk
@ 2006-04-04  3:37   ` Davide Libenzi
  0 siblings, 0 replies; 3+ messages in thread
From: Davide Libenzi @ 2006-04-04  3:37 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: Linux Kernel Mailing List, Andrew Morton, michael.kerrisk

On Tue, 4 Apr 2006, Michael Kerrisk wrote:

> Davide,
>
>> Like reported by Michael Kerrisk, POLLRDHUP handling was not consistent
>> between epoll and poll/select, since in epoll it was unmaskeable. This
>> patch brings uniformity in POLLRDHUP handling.
> [...]
>> diff -Nru linux-2.6.16/fs/eventpoll.c linux-2.6.16.mod/fs/eventpoll.c
>> --- linux-2.6.16/fs/eventpoll.c	2006-04-03 20:08:23.000000000 -0700
>> +++ linux-2.6.16.mod/fs/eventpoll.c	2006-04-03 20:09:51.000000000 -0700
>> @@ -599,7 +599,7 @@
>>   	switch (op) {
>>   	case EPOLL_CTL_ADD:
>>   		if (!epi) {
>> -			epds.events |= POLLERR | POLLHUP | POLLRDHUP;
>> +			epds.events |= POLLERR | POLLHUP;
>>
>>   			error = ep_insert(ep, &epds, tfile, fd);
>>   		} else
>> @@ -613,7 +613,7 @@
>>   		break;
>>   	case EPOLL_CTL_MOD:
>>   		if (epi) {
>> -			epds.events |= POLLERR | POLLHUP | POLLRDHUP;
>> +			epds.events |= POLLERR | POLLHUP;
>>   			error = ep_modify(ep, epi, &epds);
>>   		} else
>>   			error = -ENOENT;
>
> This makes things consistent -- but in the opposite way
> from what I thought they might be.  (The alternative would of
> course have been to make POLLRDHUP un-maskable in both epoll
> and poll().)
>
> So I'm curious: what is the rationale for making POLLRDHUP
> maskable when POLLHUP is not?   Is it an issue of ABI
> compatibility; or something else?

Yes, ABI compatibility.



- Davide



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-04-04  3:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-04  3:15 [patch] uniform POLLRDHUP handling between epoll and poll/select Davide Libenzi
2006-04-04  3:31 ` Michael Kerrisk
2006-04-04  3:37   ` Davide Libenzi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.