williams has asked for the wisdom of the Perl Monks concerning the following question:
If anywhere, this is where an ECHILD would make more sense. Instead, it shows up in the server's main loop, which is the following.$SIG{CHLD}=\&reaper; ... sub reaper { 1 while waitpid -1,&POSIX::WNOHANG != -1; $SIG{CHLD}=\&reaper; }
The weird part is that the die at the end actually executes. How can this be? I thought ECHILD occurred only in wait() and waitpid(). I understand that system, piped opens, etc. do their own waiting and can generate ECHILD, but how can that error code ever show up where I'm seeing it?use Errno; ... $select=new IO::Select(); $select->add(...); ... while (1) { $!=undef; while (@ready=$select->can_read()) { handle($_) foreach @ready; } die if $select->count() == 0; #should always have at least one last unless $! == EINTR; #try again; interrupted by signal } die if $! == ECHILD;
For further background, I'm on RedHat Linux 4.5, running Perl 5.8.5. All sockets involved are IO::Sockets set to block.
This is just weird.
Jim
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Inexplicable ECHILD ("global")
by tye (Sage) on Aug 11, 2010 at 00:28 UTC | |
by williams (Beadle) on Aug 11, 2010 at 01:02 UTC | |
|
Re: Inexplicable ECHILD
by ikegami (Patriarch) on Aug 11, 2010 at 02:24 UTC | |
|
Re: Inexplicable ECHILD
by JavaFan (Canon) on Aug 11, 2010 at 09:21 UTC | |
by ikegami (Patriarch) on Aug 11, 2010 at 16:18 UTC | |
by tye (Sage) on Aug 11, 2010 at 16:12 UTC |