Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!rpi!uupsi!sunic!dkuug!freja.diku.dk!skinfaxe.diku.dk!thorinn From: thorinn@skinfaxe.diku.dk (Lars Henrik Mathiesen) Newsgroups: comp.unix.wizards Subject: Re: pty bugs & features Message-ID: <1990Sep8.234330.19036@diku.dk> Date: 8 Sep 90 23:43:30 GMT References: <5992@muffin.cme.nist.gov> <3948@auspex.auspex.com> <6038@muffin.cme.nist.gov> Sender: news@diku.dk (The Netnews System) Organization: Department Of Computer Science, University Of Copenhagen Lines: 20 In article <6038@muffin.cme.nist.gov> libes@cme.nist.gov (Don Libes) writes: >Why do pty's return EIO instead of 0 upon EOF? In my opinion, there is no such thing as an EOF when reading from a (master) pty. After all, the pty is designed to let a daemon, script program or similar pretend that it is on the outside of the machine looking in through a serial interface, receiving exactly the same bytes as would be passed over a serial line. And, barring wire-cutters and over-voltage, a serial line is very open-ended and EOF-free. However, a serial interface may have some control lines, such as DTR or RTS. These will typically be asserted when the corresponding UNIX device file is opened; they may be negated when it is closed (but only if the HUPCLS flag is set, I think). So, apart from the HUPCLS business, the EIO error on a pty master corresponds to ``DTR not asserted'', not to EOF. -- Lars Mathiesen, DIKU, U of Copenhagen, Denmark [uunet!]mcsun!diku!thorinn Institute of Datalogy -- we're scientists, not engineers. thorinn@diku.dk