On Tue, Aug 23, 2005 at 03:33:42AM -0700, Yitzchak Scott-Thoennes wrote:
> On Mon, Aug 22, 2005 at 01:29:04PM -0400, Rick Delaney wrote:
> > When $SIG{CHLD} is set to "IGNORE", wait(2) will return -1 [1].  Since
> > system returns the status as provided by wait and wait isn't providing a
> > status I think the -1 return is reasonable.  Check $! when system
> > returns -1; in this case it will say "No child processes" (ECHILD).
> > 
> > The patch after my .sig addresses this in perlfunc.
> > 
> > [1] On Linux this is not true and wait(2) will ignore the IGNORE and
> >     actually wait for the process to finish, returning the status and
> >     pid.  I personally don't think perl should support this behaviour.
> 
> ?? But this bug report is for linux.

Sorry, I wasn't paying close enough attention.  And I wasn't very
clear anyway.  I meant that perl shouldn't go out of its way to
accomodate strange behaviour that is neither SysVish or BSDish.  But I
didn't really think about it because, of course, perl is just
returning whatever the system call returns so it is not going out of
its way.

My footnote was paraphrased from `man 2 wait` and IMO the described
behaviour is a bug.  And it must have been a bug in someone else's 
opinion too since wait/waitpid do not behave like that on Linux.  At
least they don't for me with kernel 2.6.8 and a C program.  They behave
the SysV way (return -1 and set ECHILD when SIG_IGN).  I guess the man
page is out of date.

So perl is behaving exactly like the underlying system call.  Sorry
for any confusion.

-- 
Rick Delaney
[EMAIL PROTECTED]

Reply via email to