From: Zan Lynx <zlynx@acm.org>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: linux-kernel@vger.kernel.org, mk@cm4all.com
Subject: Re: [PATCH] pipe: don't block after data has been written
Date: Thu, 05 Nov 2009 10:13:10 -0700 [thread overview]
Message-ID: <4AF307A6.2010101@acm.org> (raw)
In-Reply-To: <4AF2FF5A.6050205@gmail.com>
On 11/5/09 9:37 AM, Eric Dumazet wrote:
> Max Kellermann a écrit :
>> On 2009/11/05 17:27, Eric Dumazet<eric.dumazet@gmail.com> wrote:
>>> Your patch breaks many programs, that dont use poll()/select()
>>>
>>> char result[1000000];
>>> main()
>>> {
>>> computethings();
>>> write(1, buffer, 1000000);
>>> }
>>
>> Your code does not check the return value of write(). This is a bug.
>>
>
> Welcome to real world.
Yes in the real world there are bugs. The decision is to choose which
bug you are going to expose. If it was my decision I would make the code
work as documented, as Max wants to do.
I remember many years ago needing to fix some inetd-called server code
that got unexpected partial writes on blocking sockets. It was either
Solaris or HP/UX. So this is nothing new.
In fact I think that Linux will already do short writes if a signal is
received without restart set for the handler. I found several bugs last
year in glibc and libstdc++ fwrite and iostreams regarding that.
--
Zan Lynx
zlynx@acm.org
"Knowledge is Power. Power Corrupts. Study Hard. Be Evil."
next prev parent reply other threads:[~2009-11-05 17:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-05 15:31 [PATCH] pipe: don't block after data has been written Max Kellermann
2009-11-05 16:20 ` Américo Wang
2009-11-05 16:25 ` Max Kellermann
2009-11-05 16:27 ` Eric Dumazet
2009-11-05 16:36 ` Max Kellermann
2009-11-05 16:37 ` Eric Dumazet
2009-11-05 17:13 ` Zan Lynx [this message]
2009-11-05 18:32 ` Alan Cox
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=4AF307A6.2010101@acm.org \
--to=zlynx@acm.org \
--cc=eric.dumazet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mk@cm4all.com \
/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.