Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!hao!ames!pasteur!ucbvax!hplabs!hpda!hpcupt1!davel From: davel@hpcupt1.HP.COM (Dave Lennert) Newsgroups: comp.unix.questions Subject: Re: setting the control terminal (how?) Message-ID: <6060004@hpcupt1.HP.COM> Date: 15 Jan 88 04:46:45 GMT References: <435@picuxa.UUCP> Organization: Hewlett Packard, Cupertino Lines: 14 > A setpgrp() will fail to work in a process which has already done a setgprp(). True, but the posted code does a fork() first, which is the only reliable way to do it, so that it is guaranteed to not already be a process group leader. Short of a kernel bug (as some have suggested), the open() will also fail to assign a new controlling terminal if the opened terminal is already a controlling terminal for another process group. This is all assuming System V (which it appears you are using since your setpgrp() contains no arguments). BSD does this slightly magic differently. -Dave Lennert HP ihnp4!hplabs!hpda!davel uunet!hpda!davel