[net.bugs.usg] Uniplus Unix 3 and O_NDELAY IO

guy@rlgvax.UUCP (Guy Harris) (02/19/84)

The bug in System III no-delay reads from a terminal is that the system
always claims that there are no characters available to read.  The fix is
to change the lines in "ttread" in "io/tty.c":

	if (tq->c_cc == 0)
		if (u.u_fmode&FNDELAY)
			return;
		else
			canon(tp);

to:

	if (tq->c_cc == 0)
		if (u.u_fmode&FNDELAY && tp->t_rawq.c_cc == 0)
			return;
		else
			canon(tp);

Thanks and a tip of the Hatlo to Warren Montgomery of BTL UNIX EMACS fame,
who discovered this while trying to get EMACS' "look ahead and cancel redrawing"
code to work on System III.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy