lkml.org 
[lkml]   [2006]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH/RFC] POLLHUP tinkering ...
From
From: Davide Libenzi <davidel@xmailserver.org>
Date: Sun, 8 Jan 2006 16:02:10 -0800 (PST)

> But if and hangup happened with some data (data + FIN), they won't
> receive any more events for the Linux poll subsystem (and epoll,
> when using the event triggered interface), so they are forced to
> issue an extra read() after the loop to detect the EOF
> condition. Besides from the extra read() overhead, the code does not
> come exactly pretty.

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.
-
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:10    [W:0.081 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site