Still In The Table

int main(void) {
    pid_t p = fork();
    if (p == 0)
        _exit(3);
    sleep(60);          /* parent never calls wait() */
    return 0;
}

You run this and immediately check ps in another terminal. What do you see for the child, and what eventually removes its process-table entry?

A

State S (sleeping), because the child is blocked waiting for the parent to acknowledge it

B

State Z (defunct), holding a PID and its exit status; the entry is released when the parent reaps it, or when the parent exits and init reaps it for you

C

State Z (defunct); the kernel garbage-collects the entry after a short timeout even if nobody reaps it

D

Nothing; _exit() releases the entry immediately and SIGCHLD is ignored by default