Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: orion@iastate.edu (Phi H Truong)
Subject: Re: Can't set pgid
Date: 28 Feb 1995 17:20:06 GMT	[thread overview]
Message-ID: <3ivm06$sld@news.iastate.edu> (raw)
In-Reply-To: dgmD4Hq79.1BC@netcom.com

In article <dgmD4Hq79.1BC@netcom.com>, Darshan Maharana <dgm@netcom.com> wrote:
>Hi netters !
>
>I am porting an application from Ultrix to Dec OSF/1 V.3.0. I require 
>following process relationship :
>
>I have process which forks a child process. The parent has controlling 
>terminal attached to it. So it is inherited by child. Now, I want to
>disassociate child from it's control terminal but want to keep (or put 
>back) child in its parents process group.

I think this should work:

	int pid = getppid();

	(void) setpgid(getpid(), pid);

>    if(fork()) {
>       /* parent process */
>      fd = open(tty_device, O_RDWR);
>      ioctl(fd, TIOCSCTTY, 0); /* reaquire control terminal */
>    } else {

	setpgid(0,pid);

>      /* continue as a child  without control terminal 
>         with the same process group as parent */

-- 
_____
Phi H. Truong              "Hmmmmmmmm....... "      
orion@iastate.edu          ISU Computation Center
Systems Analyst            237 Durham Center         ph: (515) 294 -1420


      parent reply	other threads:[~1995-02-28 17:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-24  6:04 Can't set pgid Darshan Maharana
1995-02-27 16:47 ` Peter da Silva
1995-02-28 17:20 ` Phi H Truong [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox