Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!bonnie!akgua!gatech!seismo!brl-tgr!tgr!ron@BRL.ARPA From: ron@BRL.ARPA (Ron Natalie) Newsgroups: net.unix-wizards Subject: Re: am I in background? Message-ID: <3072@brl-tgr.ARPA> Date: Sat, 9-Nov-85 11:31:01 EST Article-I.D.: brl-tgr.3072 Posted: Sat Nov 9 11:31:01 1985 Date-Received: Tue, 12-Nov-85 04:16:35 EST Sender: news@brl-tgr.ARPA Lines: 22 Received: from brl-aos.arpa by SEM.BRL.ARPA id a001336; 8 Nov 85 21:18 EST Received: from rice2-gateway by AOS.BRL.ARPA id a007522; 8 Nov 85 21:06 EST > What? Not with the c-shell. If the login process (the shell) still > has the control terminal open, then the process doing the read always > gets a SIGTTIN (actually, the whole process group get the TTIN). I was wrong, but you misstate the correction. It has nothing to do with whether the shell has the control terminal open. It depends on whether the tty process group equals the process group of the process. This is the surefire way of checking for background status under csh and the Bourne shell in jobs mode. However, it falls down for normal Bourne shell, since the process groups will match even for background jobs. If you are ignoring or masking TTIN, you will get a real EOF however. What happens when the shell dies on most BSD systems is that the shells parent or some related process (like rlogind) sends a VHANGUP. A misnomer, what this really does is turn off both the READ and WRITE bits on all the file structures that reference the terminal in question. -Ron