Need help spawning a child

Brian Litzinger brian at apt.UUCP
Wed Jun 21 07:33:57 AEST 1989


I have a daemon process that spawns child processes to do some
sub-tasks.  The sub-tasks are asynchronise and the parent doesn't
care how successful the children are.  Therefore the parent process
never waits for the child.  This results in my process table filling
up with <defunct> processes over time.  

I simply want the child processes to exit and go away forever.  I
do not want the parent to have to wait on it.

I use fork(2) to create the process, and have used both exec(2), and
system(3) to run the actual job.  I've tried setpgrp(2) in the child
process but it did not make any difference.

>From ps(1):

   "A process that has exited and has a parent, but has not yet been
    waited for by the parent, is marked <defunct>."

Elsewhere I found information that a defunct process holds no
system resources except to a slot in the process table.

I have a V.3.2 system, so BSDism's won't help me.

Any help would be appreciated.

<>  Brian Litzinger @ APT Technology Inc., San Jose, CA
<>  UUCP:  {apple,sun,pyramid}!daver!apt!brian    brian at apt.UUCP
<>  VOICE: 408 370 9077      FAX: 408 370 9291



More information about the Comp.unix.questions mailing list