Micah J. Cowan micah at cowan.name
Fri Sep 15 21:01:29 BST 2006

On Fri, Sep 15, 2006 at 02:06:56PM -0500, Rocco Stanzione wrote:
> "Internally, for purposes of deciding whether a command exits with a non-zero 
> exit status, the shell shall recognize the entire status value retrieved for 
> the command by the equivalent of the wait() function WEXITSTATUS macro (as 
> defined in the System Interfaces volume of IEEE Std 1003.1-2001). When 
> reporting the exit status with the special parameter '?', the shell shall 
> report the full eight bits of exit status available."

Others have already pointed out the irrelevance of these quotes to the
actual bug under discussion. I'd also like to point out that your
reading of them is incorrect from an exit status point of view as well.

Even in bash, executing ( exit -1 ) will result in a value of 255 in $?,
as, just with return, the exit status for all processes is stored in an
unsigned 8-bit field within an int.

> and in the documentation for wait(),
> "If wait() or waitpid() returns due to the delivery of a signal to the calling 
> process, -1 shall be returned and errno set to [EINTR]."

The return value of wait() or waitpid() has nothing whatsoever to do
with the return value of a child process, which is stored in the
|stat_loc| argument to wait() or waitpid().

Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...

More information about the ubuntu-devel mailing list