How to allow one process to talk to tty while stty tostop?

Dave Cohrs dave at rsch.wisc.edu
Tue Oct 28 03:48:54 AEST 1986


In <1979 at well.UUCP> rlw at well.UUCP (Bob Weissman) writes:
> I have a background process I would like to be able to write to the tty
> while `stty tostop' is in effect.  Is this possible, and if so, how do
> ya do it?

It's possible, and it's even easy.  When "tostop" is set, a process
gets sent a SIGTTOU signal if it tries to write to the tty and it's
not in the current process-group for the tty.  The SIGTTOU stops the
process.

The easiest way to keep from stopping is to insert the line:

	signal(SIGTTOU, SIG_IGN);

somewhere in your "unstoppable" program before it prints anything.

--
Dave Cohrs
(608) 262-1204
..!{harvard,ihnp4,seismo,topaz}!uwvax!dave
dave at rsch.wisc.edu



More information about the Comp.unix mailing list