Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site sdcrdcf.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!houxm!vax135!petsd!pesnta!hplabs!sdcrdcf!curt
From: curt@sdcrdcf.UUCP (Curt Dodds)
Newsgroups: net.unix,net.unix-wizards
Subject: setpgrp() affecting TTY GROUP ID
Message-ID: <2366@sdcrdcf.UUCP>
Date: Thu, 26-Sep-85 17:41:29 EDT
Article-I.D.: sdcrdcf.2366
Posted: Thu Sep 26 17:41:29 1985
Date-Received: Mon, 30-Sep-85 01:29:28 EDT
Reply-To: curt@sdcrdcf.UUCP (Curt Dodds)
Distribution: net
Organization: System Development Corp. R+D, Santa Monica
Lines: 19
Xref: watmath net.unix:5757 net.unix-wizards:15042

References:

I am using setpgrp() (in a shell that I am writing) to change the PROCESS
GROUP ID of the child after the first fork().  This allows me to use kill()
to send signals to that child and all of its children (because they
share the same PROCESS GROUP ID).

However, it seems that certain programs which try to open the device
"/dev/tty" don't work when setpgrp() has been called.  Examples are
"su" and a version of "mail" that I have.

A symptom: a "ps" shows the TTY of each child to be "?".
		   I can even type "ps -t\?" and get a list of these children.

Nowhere in the documentation is it indicated that setpgrp() should have
any effect on the controlling terminal for a process.

Why is this happening?

P.S.
By removing the call to setpgrp() this problem disappears completely.