lkml.org 
[lkml]   [2006]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC] POLLHUP tinkering ...
On Sun, 8 Jan 2006, David S. Miller wrote:

> From: Davide Libenzi <davidel@xmailserver.org>
> Date: Sun, 8 Jan 2006 16:11:10 -0800 (PST)
>
>> On Sun, 8 Jan 2006, David S. Miller wrote:
>>
>>> The extra last read is always necessary, it's an error synchronization
>>> barrier. Did you know that?
>>>
>>> If a partial read or write hits an error, the successful amount of
>>> bytes read or written before the error occurred is returned. Then any
>>> subsequent read or write will report the error immediately.
>>
>> Sorry for the missing info, but I was clearly talking about O_NONBLOCK
>> here.
>
> What I said still applies to O_NONBLOCK.

I thought you said in _not_ necessary, sorry. The extra read() for error
discovery is just bogus, w/out proper Linux poll reporting. The epoll
interface will have wait queue heads dropped inside the monitored devices
wait queue, so I assume that an error condition would trigger a wakeup ->
epoll event. If this is not true (but I'm pretty much sure it is), look at
the extra read() for error reporting:

1) Good

read_loop();
--> Error happen on device
if (read() == ERROR)
gotcha();

2)

read_loop();
if (read() == ERROR)
whoops();
--> Error happen on device




- Davide


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-09 01:37    [W:0.059 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site