rlogin drops output when stop/start characters change

Guy Harris guy at sun.uucp
Mon Sep 2 17:50:40 AEST 1985


> > "rlogind" also sends an out-of-band message if it receives a
> > TIOCPKT_FLUSHWRITE packet from the master side of the pty.  (I
> > haven't look at the code myself, but I'm told that the kernel never
> > produces this packet type.)
> 
> Ah, but it does!  Look at the code for ptsstop and note the comment;
> and compare the values of TIOCPKT_FLUSHREAD and FREAD, and those of
> TIOCPKT_FLUSHWRITE and FWRITE.  Recall that a TTY stop routine is
> called both for flow control (^S/^Q) and for I/O flushes (TIOCFLUSH
> and signals).

Interestingly (or grossly, take your pick) enough, when ttyflush is called
with FREAD but not FWRITE, not TIOCPKT_FLUSHREAD will be generated.  The
d_stop routine is called only if output is being flushed.  (The S5 generic
tty driver/unit driver interface is much cleaner; there's a general "special
function" call and it has separate commands for "block input", "unblock
input", "restart output", "suspend output", "resume suspended output",
"transmit break", "flush output", and "flush input".  Overloading "freeze
output" with "flush output and maybe input too" is asking for trouble.)

	Guy Harris



More information about the Comp.bugs.4bsd.ucb-fixes mailing list