← BYTES
Unix IPC·Starter·Ref: 15.1.18

What happens to a child process whose parent exits (or is killed) before the child does, on a typical Unix system?

Have a question about this video? Mention reference 15.1.18 when you contact us.

a.The child is immediately and automatically terminated as well
b.The child's process ID is permanently frozen and can never be reused
c.The child becomes an 'orphan' and is automatically re-parented to a special ancestor process (traditionally PID 1, 'init', or on modern Linux sometimes a designated 'subreaper')
d.The operating system halts entirely until the issue is manually resolved
An orphaned child isn't killed or left parentless -- the kernel automatically reparents it to init (PID 1) or, on systems using the modern PR_SET_CHILD_SUBREAPER mechanism, to a nearer designated 'subreaper' process, specifically so there's always some ancestor around whose eventual wait() call will reap the orphan's exit status once it does terminate, preventing it from becoming a permanent zombie.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES15118#UnixIPC