Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!husc6!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP Newsgroups: comp.unix.wizards Subject: Re: bizarre output from getpgrp() Message-ID: <731@mcgill-vision.UUCP> Date: Mon, 6-Apr-87 23:04:43 EST Article-I.D.: mcgill-v.731 Posted: Mon Apr 6 23:04:43 1987 Date-Received: Sun, 12-Apr-87 05:43:05 EST References: <704@avec.UUCP> Organization: McGill University, Montreal Lines: 28 In article <704@avec.UUCP>, sean@avec.UUCP (Sean McGuire) writes: > This is to a Xenix (with V7 tty drivers) and a 68020 chip. The > manufacturer will remain anonymous. Their call to getpgrp() returns > the pid. My understanding is that the default process group is the > pid of your login shell unless you set it otherwise (via setprgp()). Depends on the shell. Any shell that does job control (such as most (all?) implementations of the csh) must place jobs in process groups of their own. Normally, the process group is the PID of the group leader; if there is only one process in the job (the usual case), this means that the group ID is the process ID. If, on the other hand, the following prints "broken", then they have changed the semantics significantly: int old,new; old=getpgrp(getpid()); if (fork()) { new=getpgrp(getpid()); if (new != old) printf("broken\n"); } der Mouse Smart mailers: mouse@mcgill-vision.uucp USA: {ihnp4,decvax,akgua,utzoo,etc}!utcsri!musocs!mcgill-vision!mouse think!mosart!mcgill-vision!mouse ARPAnet: think!mosart!mcgill-vision!mouse@harvard.harvard.edu