in reply to return value from system call, exit status, shift right 8, bitwise and, $?
My understanding of the system function is that it returns a 16-bit value, where the high 8 bits are the exit status, and the low 8 are the signal id.Can we really rely on this? I know that this is true for the Perl implementations I worked with, but I can't find anywhere in the docs that the exist status has to be 8 bit. This is certainly true for Unix-like systems. On Windows, programs can return 32 bit exitcode (although at least ActiveState Perl 5.8 and 5.10 throws away part of the bits). I could imagine that in later/different implementations, all 32 bits could be returned on Windows.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: return value from system call, exit status, shift right 8, bitwise and, $?
by Khen1950fx (Canon) on Feb 11, 2010 at 12:13 UTC | |
by rovf (Priest) on Feb 11, 2010 at 12:43 UTC |