Skip to main content

wait_for_pidfd_exit

Function wait_for_pidfd_exit 

Source
fn wait_for_pidfd_exit(pidfd: c_int) -> Result<()>
Expand description

Blocks until the process behind pidfd exits.

poll() is never restarted after a signal handler runs (signal(7)), and srv catches SIGCHLD, which every exiting child sends. When the kernel delivers one to this thread, poll() fails with EINTR while the parent is still alive, so retry; only a readable pidfd means the parent exited.