gtpc2m9j | C/C++ Language Support User's Guide |
This macro queries the child termination status provided by the wait and waitpid functions. If the WIFEXITED macro indicates that the child process exited normally, the WEXITSTATUS macro returns the exit code specified by the child process.
Format
#include <sys/wait.h> int WEXITSTATUS(int status);
Normal Return
The WEXITSTATUS macro is always successful.
If the WIFEXITED macro indicates that the child process exited normally, the WEXITSTATUS macro returns the exit code specified by the child. If the WIFEXITED macro indicates that the child process did not exit normally, the value returned by the WEXITSTATUS macro has no meaning.
Error Return
Not applicable.
Programming Considerations
None.
Examples
See wait-Wait for Status Information from a Child Process for an example of the WEXITSTATUS macro.
Related Information