From: "Michael Kerrisk (man-pages)" <mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Sam Varshavchik <mrsam-W1w4QoW4mIDgLSHwZvcCBg@public.gmane.org>,
linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: Description of POLLHUP in poll(2)
Date: Sat, 02 May 2015 09:27:01 +0200 [thread overview]
Message-ID: <55447C45.1070607@gmail.com> (raw)
In-Reply-To: <cone.1280020358.708902.17185.500-lO+bjgoT4TKm14v+eVDVcBDJ/jce7dRH@public.gmane.org>
Hello Sam,
On 07/25/2010 03:12 AM, Sam Varshavchik wrote:
> I'd like to propose adding the following to the current, somewhat terse,
> description of POLLHUP:
>
> ==
>
> For stream sockets, this indicates that the peer closed its side of the
> connection. This does not necessarily imply that there's no more data to be
> read from the socket. POLLHUP may be set even if some unread data remains in
> the socket. Applications that need to process all data sent from their
> socket peer should use read(2) to check for unread data if POLLHUP is set.
>
> ==
>
> That's something I didn't know -- I still learn something new every day --
> When I get a POLLHUP I've assumed that it indicates an end-of-file
> condition, but that's not apparently the case, and having this documented
> would be helpful.
Long after the fact...
I added this text:
[[
Note that when reading from a channel such as a pipe or a stream socket,
this event merely indicates that the peer closed its end of the channel.
Subsequent reads from the channel will return 0 (end of file)
only after all outstanding data in the channel has been consumed.
]]
And also made a similar change in epoll_ctl(2).
Thanks for the report.
Cheers,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2015-05-02 7:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-25 1:12 Description of POLLHUP in poll(2) Sam Varshavchik
[not found] ` <cone.1280020358.708902.17185.500-lO+bjgoT4TKm14v+eVDVcBDJ/jce7dRH@public.gmane.org>
2015-05-02 7:27 ` Michael Kerrisk (man-pages) [this message]
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=55447C45.1070607@gmail.com \
--to=mtk.manpages-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mrsam-W1w4QoW4mIDgLSHwZvcCBg@public.gmane.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 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.