Re: daemon caching weird exit status from a shell script
- From: jt@xxxxxxxxxxx (Jens Thoms Toerring)
- Date: 21 Mar 2007 19:53:31 GMT
brasilino@xxxxxxxxx <brasilino@xxxxxxxxx> wrote:
<snipet>
WEXITSTATUS(status)
evaluates to the least significant eight bits of the
return code
of the child which terminated, which may have been
set as the....
</snipet>
It evaluates the *most* significant eight bits... not the *least* one,
as I could see.
Actually no - WEXITSTATUS() returns only the least significant eight
bits of the value the program returned, so if it returns something
above 255 the value is truncated. Where those bits are stored in
the value you got back from waitpid() isn't meant by the above and
it shouldn't be of any concern to you, the macro exists just for the
purpose that you don't have to know - some other system than the one
you are currently using might store the return value somewhere else
in 'status', but on such a system WEXITSTATUS() will be defined accor-
dingly and you can run your program without applying any changes.
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@xxxxxxxxxxx
\__________________________ http://toerring.de
.
- References:
- daemon caching weird exit status from a shell script
- From: brasilino@xxxxxxxxx
- Re: daemon caching weird exit status from a shell script
- From: Jens Thoms Toerring
- Re: daemon caching weird exit status from a shell script
- From: brasilino@xxxxxxxxx
- daemon caching weird exit status from a shell script
- Prev by Date: Re: Is splint the best for static code checking? I mean free.
- Next by Date: File Handling
- Previous by thread: Re: daemon caching weird exit status from a shell script
- Next by thread: system() function
- Index(es):