pty bugs & features
Lars Henrik Mathiesen
thorinn at skinfaxe.diku.dk
Sun Sep 9 09:43:30 AEST 1990
In article <6038 at muffin.cme.nist.gov> libes at 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 at diku.dk
More information about the Comp.unix.wizards
mailing list