From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,bb6d74cd0429da99 X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-02-28 11:46:35 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!news.alpha.net!uwm.edu!vixen.cso.uiuc.edu!newsrelay.iastate.edu!news.iastate.edu!orion From: orion@iastate.edu (Phi H Truong) Newsgroups: comp.unix.osf.osf1 Subject: Re: Can't set pgid Followup-To: comp.unix.osf.osf1 Date: 28 Feb 1995 17:20:06 GMT Organization: Iowa State University, Ames, Iowa (USA) Sender: orion@iastate.edu (PUT YOUR NAME HERE) Message-ID: <3ivm06$sld@news.iastate.edu> References: Reply-To: orion@iastate.edu (PUT YOUR NAME HERE) NNTP-Posting-Host: tigger.cc.iastate.edu In article , Darshan Maharana 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