tty w/wo modem control inquiry

Kenneth Almquist ka at hropus.UUCP
Thu Apr 17 04:10:53 AEST 1986


	Furthermore, my experience on one system is that with modem control, if
	DCD is dropped after the open, and read(2)s or write(2)s to the port
	will block until DCD is restored.

In SysV, read is supposed to return zero after carrier is dropped, according
to the termio manual page.  I don't think that the manual says what write is
supposed to do in this situation; the device drivers that I have experimented
with all return zero when this happens (or a short count if carrier drops in
the middle of a write).

	Maybe someone else can detail how read(2) and write(2) are *supposed*
	to be affected of the O_NDELAY flag.

In SysV, reads on a tty should not roadblock if data is not available; they
should return 0 instead.  It is true that the UNIX manual says nothing about
the effects of the O_NDELAY flag on writes to a tty; I believe that this om-
ission was an intentional one, indicating that the O_NDELAY flag should have
no effect on writes to a tty.

The preceding paragraph applies only to System V.  4.2 BSD also has no delay
I/O, but under BSD read returns an error indication rather than zero to in-
dicate that no data is available.  I believe that the Berkeley approach is
better (since it avoids the confusion between "no data available" and "end of
file"), but it does mean that System V and BSD are incompatible in this area.
				Kenneth Almquist
				ihnp4!houxm!hropus!ka	(official name)
				ihnp4!opus!ka		(shorter path)



More information about the Comp.unix.wizards mailing list