Practice · 1 of 4
Decode the Exit Status
CHALLENGE
Difficulty: advanced+25 XP
POSIX. run_exit_status(code) (given) forks a child that exits with code and returns the raw waitpid status word. Implement int decode_exit(int status) returning the child's exit code if it exited normally, or -1 if it did not exit normally. Remember: exit codes are the low 8 bits.
Press Submit to check your solution.
Back to lesson: Practice: Process Machinery Drills