[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems with the undead (zombies)



On Sun, Jun 07, 1998 at 11:03:35PM +0200, Gergely Madarasz wrote:
> On Sun, 7 Jun 1998, Jason Gunthorpe wrote:
> 
> > 
> > On Sun, 7 Jun 1998, Brandon Mitchell wrote:
> > 
> > > More incentive to do it in a signal handler, tested code:
> > > void sig_handler (int i) {
> > >   if (i == SIGCHLD) { /* signal based reaper */
> > >     while (wait3(NULL, WNOHANG, 0) > 0);
> > >   }
> > > }
> > 
> > The man pages do not say that wait is signal safe, putting it in a single
> > handler could nuke your program in some situations.
> 
> Hmm... isn't signal(SIGCHLD,SIG_IGN) the best for this situation anyway?

Yes it is....I did it and it worked...
what I find weird is this...
When i checked teh documentation it says that "By Default SIGCHLD is ignored"
(well basically im paraphrasing..it was probably part of a table, but it
was in more than one doc)

However zombies are still made...yet..if you use signal(SIGCHLD,SIG_IGN) that
gets rid fo them. I find this weird..maybe the book (or was it in aman page?)
was wrong..or rather..in-precise when it listed SIGCHLD as "ignored" because
by 1 standard it _IS_ ignored as in, if there is no signal handler for it
then nothing special is done (like dumping core). Perhaps they meant
ignored only in this sense and not in the sense of "ignored" as in you told
the system that you will ignore this signal

I realize now this is pretty elementary (I knew it was but I couldn't for the
life of me, when I first asked, remember where I read about it) but...
seems to still be a point of confusion.

once again thanx for the info

-Steve 

> --
> Madarasz Gergely           gorgo@caesar.elte.hu         gorgo@linux.rulez.org
>       It's practically impossible to look at a penguin and feel angry.
>           Egy pingvinre gyakorlatilag lehetetlen haragosan nezni.
>               HuLUG: http://www.cab.u-szeged.hu/local/linux/
> 
> 

-- 
** Stephen Carpenter ** ** ** ** ** ** ** ** ** ** ** ** sjc@delphi.com **
"Maturity is often more absurd than youth and very frequently is most 
unjust to youth"
-- Thomas Edison 

Attachment: pgpu7MKeZaCeW.pgp
Description: PGP signature


Reply to: