suaveant has asked for the wisdom of the Perl Monks concerning the following question:
When I have freshly started the ACGI, the first waitpid says the exit value was 0 (should be 1), all subsequent waitpids return 255 (should be 0). Any time after that they are all 255
As far as I see there are no end blocks screwing up the value, and an END block I specially put in at the end shows the proper exit values
The ACGI code that I am running is itself a child of a parent ACGI process, so I am thinking that maybe the dual level of forks is the problem, but it doesn't seem that it should be. But as the tests below show, the outer fork does seem to confuse the issue
The box in question is solaris 2.7, with perl 5.6.1...
UPDATE My bad on the test code... see bluto's messages... still have the real problem, tho. The following example is useless
when I run the following one-liner
perl -e 'if(fork){if(fork){waitpid(-1,undef);print"-- ",$?>>8,"\n";}else{exit 4}}'
I get random responses... either 4 or 0... no pattern.
On my debian box with 5.8.2, I always get 4...
and on my redhat box at work with 5.8.0 I always get 0...
Am I going crazy? Did I find a bug? Can I make this work somehow?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Waitpid Woes
by Zaxo (Archbishop) on Dec 17, 2003 at 19:39 UTC | |
by suaveant (Parson) on Dec 18, 2003 at 16:46 UTC | |
|
Re: Waitpid Woes
by bluto (Curate) on Dec 17, 2003 at 19:20 UTC | |
by suaveant (Parson) on Dec 17, 2003 at 19:26 UTC | |
by bluto (Curate) on Dec 17, 2003 at 19:37 UTC | |
by suaveant (Parson) on Dec 17, 2003 at 19:40 UTC | |
by bluto (Curate) on Dec 17, 2003 at 19:49 UTC | |
|