mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davide Libenzi <davidel@xmailserver.org>
To: "David S. Miller" <davem@davemloft.net>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH/RFC] POLLHUP tinkering ...
Date: Sun, 8 Jan 2006 16:11:10 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.63.0601081610130.6925@localhost.localdomain> (raw)
In-Reply-To: <20060108.160802.103497642.davem@davemloft.net>

On Sun, 8 Jan 2006, David S. Miller wrote:

> 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.

Sorry for the missing info, but I was clearly talking about O_NONBLOCK 
here.



- Davide



  reply	other threads:[~2006-01-09  0:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-09  0:02 Davide Libenzi
2006-01-09  0:08 ` David S. Miller
2006-01-09  0:11   ` Davide Libenzi [this message]
2006-01-09  0:20     ` David S. Miller
2006-01-09  0:35       ` Davide Libenzi
2006-01-09  3:13   ` David Schwartz
2006-01-09  4:55     ` Davide Libenzi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.63.0601081610130.6925@localhost.localdomain \
    --to=davidel@xmailserver.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®