should init inherit orphans? - (nf)

rpw3 at fortune.UUCP rpw3 at fortune.UUCP
Sat Jan 14 10:07:10 AEST 1984


#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



More information about the Comp.unix.wizards mailing list