[net.unix] How to allow one process to talk to tty while stty tostop?

rlw@well.UUCP (Bob Weissman) (10/26/86)

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?

Thanks!
-- 

   Bob Weissman
   Internet:	G.WEISSMAN@SU-SCORE.ARPA
   Usenet:	...!{hplabs | lll-crg | glacier | ptsfa}!well!rlw
    (or)	...!decwrl!acornrc!bob

dave@rsch.wisc.edu (Dave Cohrs) (10/27/86)

In <1979@well.UUCP> rlw@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@rsch.wisc.edu