modem control on 3B2

Leslie Mikesell les at chinet.UUCP
Wed Jun 15 00:16:12 AEST 1988


In article <6604 at sigi.Colorado.EDU> wu at spot.Colorado.EDU (WU SHI-KUEI) writes:
>Would some kind person explain to me what is meant by 'modem control' as used
>in either 'stty' or 'ioctl'.  Specifically, what effect does turning the option
>on (off) have on a 3B2 running 5.2.04 and using the combo (4 serial, one
>parallel) port card.
>
The 4-serial port cards on the 3B2 do not have do anything with the RTS/CTS
lines, so the only thing that you can change is the need for CD to be present.
Normally, open() will not complete until CD (carrier detect) is asserted
on the RS232 line, and if it goes away after the line is opened, a write()
to the port will return an error and a read() will return no data.  If
the line is the controlling terminal for a process, the process may also
receive a hangup signal.

The necessity to observe CD can be disabled (for example to chat with a
smartmodem when there is no connection) by setting the O_NDELAY flag in
the open() (you must then use fcntl() to clear it or some very strange
things will happen), and then use ioctl() to set the CLOCAL flag.
Note that there is a bug in the release 5.2 and earlier tty drivers that
will cause an open() without O_NDELAY to hang forever if another process
opens the same port with O_NDELAY asserted.  This would be the case if
you have uugetty running on a port and attempt to dial out with O_NDELAY
set.  This has been fixed in release 3.1, but 5.2 required setting modems
to hold CD on at all times.

  Les Mikesell



More information about the Comp.sys.att mailing list