Bug#541551: perl-base: detecting stopped child process fails using POSIX WIFSTOPPED

Brendan O'Dea bod at debian.org
Tue Aug 18 23:14:03 UTC 2009


So it seems that this is an intentional upstream change*.

The perlvar entry for $? now notes that it contains "the 16-bit status
word returned by the traditional Unix wait() system call (or else is
made up to look like it).  Thus, the exit value of the subprocess is
really ($? >> 8), and $? & 127 gives which signal, if any, the process
died from, and $? & 128 reports whether there was a core dump."

Unfortunately, a stopped process does not fit these semantics and
moreover the W*() macros expect the un-molested status word as
argument.

You will need to change your code to test ${^CHILD_ERROR_NATIVE}
rather than $? with the W*() macros.

--bod

* http://www.mail-archive.com/perl5-changes@perl.org/msg11298.html






More information about the Perl-maintainers mailing list