Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jul 95 22:45:38 MDT
From:      terry@cs.weber.edu (Terry Lambert)
To:        filo@yahoo.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Ignoring SIGCHLD without having to wait()?
Message-ID:  <9507170445.AA18374@cs.weber.edu>
In-Reply-To: <199507162343.QAA05963@lobo.yahoo.com> from "filo@yahoo.com" at Jul 16, 95 04:43:28 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> >From what I can tell FreeBSD like other BSD systems requires you to
> wait() on children to clean up after them on their exit, otherwise
> they become zombies until the parent dies.  In the case where you
> don't care about the exit status of the child, this becomes an
> unecessary burden.  SysV solves this by allowing the parent to ignore
> these via SIG_IGN.
> 
> Am I missing something, or is there no way to do this in FreeBSD?  We
> currently have an app where a significant portion of the CPU time is
> spent servicing these interrupts.  The double fork solution is not an
> option.
> 
> If there is no simple solution, does anyone have advice before I start
> looking at hacking the kernel to provide this functionality.  Has
> anyone looked into this before?  Any info on this would be
> appreciated.

The default behaviour is to send a signal and to reap the child.

I believe that the "ignore" is supposed to work: that is, it will cause
the exit status to be automatically reaped.  That is, _exit will check
the mask on the parent process and react accordingly.


One potential for error is the case of the signal ignore being set
*after* the child is created.  I believe that this would be an error
in BSD were it the case, but at least it's one that you can easily
work around.


					Terry Lambert
					terry@cs.weber.edu
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9507170445.AA18374>