// status-word - show the exit status word from a program #include #include #include #include int main(void) { int status; pid_t pid = fork(); if (pid < 0) err(1, "fork failed"); if (pid) { wait(&status); printf("%d %d\n", status, status >> 8); } else { execlp("false", "false", (char *) 0); err(1, "execl failed"); } return 0; }