core files under SV

RAMontante bobmon at iuvax.cs.indiana.edu
Fri Nov 17 11:24:30 AEST 1989


gwyn at brl.arpa (Doug Gwyn) <11616 at smoke.BRL.MIL> :
-
-	if ( fork() == 0 )
-                abort();
  !			/* [ child not cleaned from proc. table? ] */
-
-As somebody else pointed out, if you do lots of these you also need
-to reap the zombies.
		[ . . . ]
-If you don't want to wait for the core dump to complete before
-proceeding, arrange for the dumping child to be detached:
-
-	if ( (pid = fork()) == 0 )
-		if ( fork() == 0 )
-	                abort();
-		else
-			_exit( 0 );
-	else
-		while ( wait( (int*)0 ) != pid )
-			;

Um, I don't see why this "reaps the zombies".  I thought the `wait(pid)'
call was added to clean up the aborted child --- here the child is
wait()'ed on, but the grandchild looks just like the child did in the
original version.



More information about the Comp.unix.questions mailing list