develooper Front page | perl.perl5.porters | Postings from September 2013

[perl #85228] Broken waitpid

Thread Next
From:
Tony Cook via RT
Date:
September 10, 2013 01:03
Subject:
[perl #85228] Broken waitpid
Message ID:
rt-3.6.HEAD-1873-1378775019-487.85228-15-0@perl.org
On Tue Jun 25 00:47:24 2013, Mark@Overmeer.net wrote:
> * Eric Brine (ikegami@adaelis.com) [130625 06:57]:
> > On Mon, Jun 24, 2013 at 1:41 AM, Tony Cook via RT <perlbug-
> followup@perl.org
> > > wrote:
> >
> > > On Thu Mar 03 20:33:25 2011, ikegami@adaelis.com wrote:
> > > > ok, I'll rework the patch with all I've learned from this
> feedback.
> > >
> > > Did you have a chance to prepare a new patch?
> > > Otherwise I'll look at it when I get a chance.
> >
> > Right now, Perl doesn't allow waitpid(0,0) on any systems. I don't
> know
> > what on what systems waitpid(0,0) is allowed or how to test for it
> -- do
> > all systems with waitpid support waitpid(0,0)? -- so the best I can
> do is
> > change the patch to return -1 with EINVAL or to croak on all systems
> > (rather than returning -1 with errno unchanged).
> 
> Well, waitpid(0,0) is described in the POSIX manual
> 
>  * If pid is 0, status is requested for any child process whose
> process
>    group ID is equal to that of the calling process.
> 
> So, you can expect it to be implemented on many platforms.

I've attached a patch which solves this problem and I believe addresses
the other concerns raised.

That said, I suspect perl won't test successfully on a system that has
neither waitpid() not wait4() - there's too many uses of WNOHANG, which
the emulation doesn't support.

Building perl on linux with -Ud_waitpid -Ud_wait4 passed the new test,
but failed a few others (all WNOHANG uses.)

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=85228

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About