Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site fortune.UUCP Path: utzoo!linus!philabs!seismo!harpo!ihnp4!fortune!rpw3 From: rpw3@fortune.UUCP Newsgroups: net.unix-wizards Subject: Re: should init inherit orphans? - (nf) Message-ID: <2276@fortune.UUCP> Date: Fri, 13-Jan-84 19:07:10 EST Article-I.D.: fortune.2276 Posted: Fri Jan 13 19:07:10 1984 Date-Received: Sat, 14-Jan-84 23:59:50 EST Sender: notes@fortune.UUCP Organization: Fortune Systems, Redwood City, CA Lines: 31 #R:cmcl2:-127700:fortune:11600041:000:1083 fortune!rpw3 Jan 13 14:25:00 1984 Must 'init' inherit orphans? If the wait(2) call returned anything more than status, such as accounting, it might be important, but accounting is handled by the kernel directly. It just seems to be a case of the usual UNIX "well, we've got this way to clean up processes with wait(2), and init's always doing a wait, so..." It IS important that orphans lose their process groups, so signals from the terminal don't screw with background jobs. Back before setpgrp(2), the standard idiom for "clear pgrp" was (and is): if (fork()) /* parent */ wait(NIL); else if(fork()) /* first generation */ exit(0); /* send Moses down the river */ else /* second generation */ ...do work.... Orphans "inherit" init's pgrp, which is "none". But I don't see any reason that you couldn't do it in the kernel. On the other hand, what does it cost for init to do it? Well, init must swap in. What else? ... Rob Warnock UUCP: {sri-unix,amd70,hpda,harpo,ihnp4,allegra}!fortune!rpw3 DDD: (415)595-8444 USPS: Fortune Systems Corp, 101 Twin Dolphins Drive, Redwood City, CA 94065