Re: Out of ptys

Richard B. Johnson (root@chaos.analogic.com)
Thu, 27 Aug 1998 13:26:15 -0400 (EDT)


On Thu, 27 Aug 1998, Stephen Rothwell wrote:

> > From: "Richard B. Johnson" <root@chaos.analogic.com>
> > Subject: Re: Out of ptys
> > Date: Thu, 27 Aug 1998 13:28:04 +1000
> >
> > On Wed, 26 Aug 1998, Alan Cox wrote:
> >
> > > > I read your first comment on this. Your demo programs don't
> > > > relate at all to the problem.
> > >
> > > You keep claiming things don't work. Im just going to sit here proving
> > > they do. If you play this game for long enough we might even find a real
> > > library bug
> >
> > Well here it is. You chose what the "correct" behavior should be. I'll
> > except anything. However, both STDERR_FILENO and STDOUT_FILENO had
> > better function the same or there is a library problem.
>
> Except that, of course, stderr is unbuffered and stdout is line buffered.
> I would expect an unbuffered stream to noticed the (out of band) closure
> of its file descriptor before a buffered one.
>
> I concede that there is still something wrong here as stdout should
> be line buffered when it refers to a terminal and yet the error is not
> discovered in the fprintf (which should of course flush the stream due
> to the newline). Mind you, I have been mistake before ... ;-)
>
> Cheers,
> Stephen Stephen.Rothwell@canb.auug.org.au
>

Yes. You are the only one so far that observed that there _is_ a newline
in the output string so they should both operate the same. Most are
content with explaining that I don't know anything.

The program was written, not as an example of how to program, but simply
to demonstrate the problem. If I am executing `gdb` or `strace` on a
network-connected program who's socket has been duped to the three basic
fds, and the socket is closed by the peer I've got a big problem finding
what went wrong.

Cheers,
Dick Johnson
***** FILE SYSTEM WAS MODIFIED *****
Penguin : Linux version 2.1.115 on an i586 machine (66.15 BogoMips).
Warning : It's hard to remain at the trailing edge of technology.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html