[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091105183240.4f67aadc@lxorguk.ukuu.org.uk>
Date: Thu, 5 Nov 2009 18:32:40 +0000
From: Alan Cox <alan@...rguk.ukuu.org.uk>
To: Zan Lynx <zlynx@....org>
Cc: Eric Dumazet <eric.dumazet@...il.com>,
linux-kernel@...r.kernel.org, mk@...all.com
Subject: Re: [PATCH] pipe: don't block after data has been written
> > 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.
Outside of academia the reality is fairly simple. A system needs to
behave according to the expected behaviour. That is a mix of things
- Standards
- Extrapolation (applying the logic of the standard to cases beyond it)
- Tradition (things that used to work still work)
If you like: How it is defined to work, how it is expected to work and how
it worked last year.
Tradition is a suprisingly large part of it. In the unix world that
tradition includes things like "signals do not interrupt disk I/O writes
causing short writes".
Pipes however is pretty much pure standards behaviour
In blocking mode they block
In non-blocking mode they don't block
Furthermore there are specific rules about writes under a certain size
always occurring in an atomic manner.
> 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.
The kernel takes great pains not to do this in the cases where tradition
dictates otherwise (notably in disk I/O)
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists