flushtty vs XON/XOFF

utzoo!henry utzoo!henry
Thu Mar 17 22:01:40 AEST 1983


There is an interesting bit of code in the V7 tty driver.  The
flushtty() routine turns off the "stopped" bit used for stop/start
handshaking.  This is very entertaining if your terminal really
does expect the cpu to honor this protocol all the time.  This
routine is called at the following times:

	final close of the device
	TIOCSETP
	TIOCFLUSH
	interrupt or quit character
	input queue overflow

At final-close time, this is arguably reasonable, since in theory
you no longer care what the device does.  Maybe.  (In any event,
the very next line of ttyclose() after the flushtty() call gives
the same effect.)  At the other times, it can be a disaster.  It's
a mystery why this doesn't cause trouble more often;  I discovered
it when tracking down the cause of some ugly misbehavior by a printer
which is being run off a tty line temporarily.

Can anyone suggest circumstances in which this apparent botch yields
useful behavior?  I can't.  Reply by mail, please;  I'll summarize
responses for the net.



More information about the Net.bugs.v7 mailing list