tty w/wo modem control inquiry

Rob Bernardo rob at ptsfb.UUCP
Tue Apr 15 00:07:33 AEST 1986


In article <979 at rlgvax.UUCP> dennis at rlgvax.UUCP (Dennis Bednar) writes:
>What does a tty port *with* modem control mean, and
>what does a tty port *without* modem control mean?

"Modem control" means that the device to which the port is connected
must indicate its ready state before certain i/o is allowed.

If an rs-232 port has modem control, an open(2) on the port will block until
the outboard device "asserts" data carrier detect (DCD), that is, until it
puts a high voltage on on pin 8 of the rs-232 cable. However, if your open(2)
uses the flag O_NDELAY, the open(2) will return without waiting for DCD to
come high. BTW, this can be found on the manual page for open(2).

Without modem control, the port can be opened, read from and written to
without DCD being asserted.

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. I suspect that if the port was opened with the O_NDELAY flag,
read(2)s and write(2) will not block, but I don't know for sure since the system
on which I have noticed the blocking of reading and writing has a bug that
renders the O_NDELAY flag nonfunctional. The manual page for read(2) says
something similar to this, and the manual page for write(2) says nothing about
the effects of O_NDELAY on write(2)s to tty ports. Maybe someone else can
detail how read(2) and write(2) are *supposed* to be affected of the O_NDELAY
flag.

Rob Bernardo, San Ramon, CA    (415) 823-2417    {ihnp4|dual|qantel}!ptsfa!rob
			       Pacific * Bell



More information about the Comp.unix.wizards mailing list