stuff chars

Ian Donaldson rcodi at yabbie.rmit.oz
Sun Dec 7 23:39:39 AEST 1986


In article <104 at quacky.UUCP>, dce at quacky.UUCP (David Elliott) writes:
> I have never found a way to change the handling of signals such that
> input is not flushed.

If your system doesn't have TIOCSETN defined (usually in <sys/ioctl.h>) 
then you're probably out of luck.  Using stty(2) or stty(3) is equivalent
to TIOCSETP, that flushes input before changing the modes -- ie: typeahead.

stty() is a system call on older versions of UNIX (and SVR2), but 
a library routine on ones that implement the TIOCSET[NP] ioctl's (eg: bsd 
derived systems).  Similary, for gtty() and TIOCGETP.

The 4.2bsd source for vi/ex has a conditional compile of the following nature:

	#ifdef TIOCSETN
		ioctl(..., TIOCSETN, ...);
	#else
	/* some comment grumbling about problems of typeahead flushing */
		stty(..., ...);
	#endif

in the routine that changes tty modes.

SVR2 has an equivalent to TIOCSETN, TCSETAW, but it works
on a struct termio, instead of struct sgttyb.

Ian Donaldson



More information about the Comp.unix.wizards mailing list