lkml.org 
[lkml]   [1996]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux-1.3.81


On 31 Mar 1996, Miquel van Smoorenburg wrote:
>
> The fix is that the interface definition needs to be finished. It
> isn't about some bug in the code ;) However, I think the new named pipe
> code in the kernel breaks a lot of applications.
> As I see it, there _is_ a difference between pipes and fifos: you
> cannot ever re-open a pipe, but you can re-open a fifo. With the
> new code, a server (init) can only accept one request on a named pipe.
> After the client (telinit) has closed the fifo, read() keeps returning
> 0 instead of blocking and select() tells init there is data waiting...
>
> With the old SunOS behaviour it was possible to open a fifo once,
> do a select() on it and accept incoming requests from different
> clients. Now the server has to keep open()ing and close()ing the fifo,
> which is not pretty and will break lots of stuff.
>
> Linus, could you please either explain a way around this or
> restore the old behaviour of select() on pipes?

Restoring the old behaviour is simple: there is a BROKEN_SUNOS_FIFO
define (or something close to that) in fs/pipe.c, and defininf that will
use the old code.

However, I do like the new code better ("new" - it's actually the
original linux behaviour, but I had to change it because too many SunOS
people complained). And the new behaviour is also the same as Solaris etc
SVR4 boxes, so any truly _portable_ program shouldn't break anyway.

Of course, sysvinit isn't necessarily meant to be portable, and as such
it's perfectly ok to depend on linux behavioural features.

I don't like the SunOS (pre-81) behaviour, because some programs _want_
to be able to know when the clients have gone away, and returning 1 for
select when there are no writers is the "logically" correct thing to do
anyway, when you look at what "read()" does.

However, I don't feel strongly enough about this to not even consider
changing it back: I could do that. I'm not 100% sure I want to, though,
so I'd like some feedback from some more people. What do people think?
Especailly people who actually _use_ named pipes..

Linus


\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.059 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site