Author: Stan Eisenstat
Subject: Re: [Cs323] status
Date: Monday, 16 Nov 2020, 07:21:43
> Message Posted By: Unknown
>
> Why is the STATUS macro needed? ...
To extract information from the status returned by
wait() or waitpid() in an 8-bit format that includes
the signal that terminated the process (if any) and the
low-order byte of the value returned by main() or passed
to exit(), yet can be used as an exit status.
=====
> ... when does it matter for execution of a
> command that the status >= 128? ...
Any nonzero status indicates that the command failed.
=====
> ... Wouldnt the program have already exited by
> then because this means that one of the system calls failed?
No. It is the parent process that needs to know the
value returned by STATUS().
=====
> Also, just to clarify, does a status between 1 and 127 mean a failed
> process but it wasn't killed?
Yes.
--Stan-
PREV
INDEX
NEXT