WEXITSTATUS-Obtain exit status of a child process
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.

status
The status field that was filled in by the wait or waitpid function.

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.