我在 unix 的系统函数的实现中阅读了这段代码(问题 8.22):
int status;
if (wait(&status) > 0) {
if (WIFEXITED(status)) {
return WEXITSTATUS(status);
} else {
return status;
}
}
我不明白这里的 if 条件是什么:WEXITSTATUS 返回的状态与等待中的状态不一样吗?如果不是,那么两者有什么区别?