am I in background?
Ron Natalie
ron at BRL.ARPA
Sun Nov 10 02:31:01 AEST 1985
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
More information about the Comp.unix.wizards
mailing list