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

[perl #85228] Broken waitpid

Thread Previous
From:
Tony Cook via RT
Date:
September 17, 2013 06:59
Subject:
[perl #85228] Broken waitpid
Message ID:
rt-3.6.HEAD-1873-1379401132-898.85228-15-0@perl.org
On Mon Sep 09 18:03:39 2013, tonyc wrote:
> 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

Applied with some minor clean-up as
d4c027436fbaf9384f42d7c7703b2499810ed39b.

Tony


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

Thread Previous


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