[comp.unix.ultrix] Writing to Ultrix pty loses data

D. Allen [CGL]" <idallen@watcgl.waterloo.edu> (10/12/90)

I have an application that writes 600 bytes (several lines) in a chunk
through a master pty out a slave tty into another application (usually
a shell such as csh).  If the slave tty is in cooked mode, everything
works fine.  If the slave tty is put into cbreak or raw mode, the write
loses data.  If the slave tty is cbreak and tandem, the data is lost
silently.  If the slave tty is cbreak but not tandem, it beeps madly as
some buffer is over-run.  Writing the string out in 100-byte chunks
with sleep(2) calls between works, but is painfully slow.

How do I get the pty/tty pair to properly flow control the write so
that nothing gets lost?

The application is a modified version of the program "screen", and the
string it is writing is the $TERMCAP string.  The program works fine if
the program in the current window is a simple shell (cooked mode tty). 
If I start up rlogin, tip, or script (raw or cbreak tty), screen can't
get the whole string out through the pty/tty pair.

This misbehaves on both Ultrix 3.1 (VS3100) and Ultrix 3.1C (DS5400).
It works fine on 4.3 BSD (VAX785, VAX8600, etc.).
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada

D. Allen [CGL]) (10/17/90)

Under Ultrix 3.1, if you cut more than a few lines from an xterm and try
to paste into a (different) window running rlogin, the Ultrix pty will
over-run, beep madly, and lose data.  This happens whenever a lot of data
is (are) written into the master side of an Ultrix pty/tty pair and the
tty side is in raw or cbreak mode -- data gets lost.  Setting TANDEM
doesn't help.  Anyone know of a fix or work-around?
-- 
-IAN! (Ian! D. Allen) idallen@watcgl.uwaterloo.ca idallen@watcgl.waterloo.edu
 [129.97.128.64]  Computer Graphics Lab/University of Waterloo/Ontario/Canada