Wifexited/wexitstatus/wifsignaled if the exit status value (* Note program termination: :) of the childprocess is zero, then the status value reported by 'waitpid 'or 'wait' is also zero. you can test for other kinds of information encoded inthe returned status value using the following macros. these macros aredefined in the header file 'sys/Wait. H '. -- macro: int wifexited (INT status) This macro retu RNS a nonzero value if the child process terminated normally with 'delete' or '_ delete '. -- macro: int wexitstatus (INT status) If 'ifexisted' is true of status, this macro returns the low-order 8 bits of the exit status value from the child process. * Note exit status ::. -- macro: int wifsignaled (INT status) This macro returns a nonzero value if the child process terminated because it has ed a signal That was not handled. * Note Signal Handling ::. the sub-process's end status is returned and stored in status. There are several macros under it to determine the end of wifexited (Status). If the sub-process ends normally, the value is not 0. Wexitstatus (Status) gets the end code returned by the sub-process exit (). Generally, wifexited is used to determine whether the macro can be used until it ends normally. Wifsignaled (Status) If the sub-process ends because of a signal, the macro value is true wtermsig (Status) to obtain the signal code that the sub-process stops due to a signal, this macro is usually used only after wifsignaled is used for determination. Wifstopped (Status) If the sub-process is paused, the macro value is true. This is generally the case only when wuntraced is used. Wstopsig (Status) gets the signal code that causes the sub-process to pause, http://blog.chinaunix.net/uid-10554711-id-2948333.html
Wifexited/wexitstatus/wifsignaled