Questions: Process Environment and Exit Codes

5 questions to test your understanding

Score: 0 / 5
Question 1 Multiple Choice

A parent process spawns 100 children that all terminate, but the parent never calls wait(). What happens to the children?

AThe OS automatically cleans them up when they exit
BThey enter zombie state, holding their exit codes in the process table until the parent calls wait() or exits
CThey become orphans and are immediately adopted and reaped by init
DThe OS forces the parent to call wait() before it can continue executing
Question 2 Multiple Choice

A shell script checks '$?' and finds the value 127. What does this most likely indicate?

AThe command succeeded and processed 127 items
BThe command was not found — the shell could not locate the executable
CThe command was terminated by a signal
DThe command exceeded its memory limit
Question 3 True / False

When a process exits, its process table entry is immediately freed by the kernel.

TTrue
FFalse
Question 4 True / False

A process that exits with code 0 is universally understood to have succeeded.

TTrue
FFalse
Question 5 Short Answer

Why must a parent process call wait() after its children terminate, and what happens if it does not?

Think about your answer, then reveal below.