stuff chars

Guy Harris guy at sun.uucp
Wed Dec 10 12:27:16 AEST 1986


> > 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.

Yes, but that doesn't seem to be what he was asking for.  It looks like he
wanted to set things up so that a signal from the tty (SIGTSTP, in this
case) didn't cause input to be flushed.  There *is* a way to do this, both
in 4.2BSD and in S3/S5.

In 4.2/4.3, there's a bit (LNOFLSH) that can be set in the local mode word
(using TIOCLSET or  TIOCLBIS).  In S5, the bit is called NOFLSH and is set
in the "c_lflag" field of the "termio" structure.

In either system, setting this bit causes the terminal driver not to do the
normal flush of input (and output, for SIGINT and SIGQUIT) for signals
generated from the keyboard.

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

Well, actually, TCSETA is the equivalent of TIOCSETN; TIOCSETN neither waits
for output to drain nor flushes input.  TCSETAW waits for output to drain;
TCSETA doesn't.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy at sun.com (or guy at sun.arpa)



More information about the Comp.unix.wizards mailing list