Problem with old tty discipline on 4.2BSD

David H. Brierley dhb at rayssd.UUCP
Wed Nov 20 01:12:43 AEST 1985


I ran into a strange problem the other day with the old tty discipline
and I was wondering if anyone had ever seen it before.  I have a program
which is similar to sysline except that it runs as a daemon and users
run a program which "registers" them with the daemon when they want the
time and other info displayed on their status line.  The problem I have
is that since this daemon serves all of the tty lines (currently set to
a max of 40), it must open and close each tty line at each update.  If
the line in question is using the old tty discipline, opening the line
causes all pending input to be flushed.  I tracked this down to the open
routine in /sys/sys/tty.c which contains the following line:
       if (tp->t_line != NTTYDISC) ttywflush(tp);

Now my question is, why is this being done?  Can this line be safely
removed or this there some deep hidden secret that I dont know about
that requires this to be there.  One thing that I noticed immediately is
that the flush is done without regard to wether you opened the line for
input or not.  I guess they ASSUMED that nobody would ever want to open
a terminal strictly for writing.
-- 
	Dave Brierley
	Raytheon Co.; Portsmouth RI; (401)-847-8000 x4073
	...!decvax!brunix!rayssd!dhb
	...!allegra!rayssd!dhb
	...!linus!rayssd!dhb



More information about the Comp.unix.wizards mailing list