[go: up one dir, main page]

|
|
Log in / Subscribe / Register

Toward race-free process signaling

Toward race-free process signaling

Posted Dec 8, 2018 3:00 UTC (Sat) by wahern (subscriber, #37304)
In reply to: Toward race-free process signaling by kmeyer
Parent article: Toward race-free process signaling

Linux has prctl(2) PR_SET_CHILD_SUBREAPER

A subreaper fulfills the role of init(1) for its descendant
processes. When a process becomes orphaned (i.e., its
immediate parent terminates) then that process will be
reparented to the nearest still living ancestor subreaper.
Subsequently, calls to getppid() in the orphaned process will
now return the PID of the subreaper process, and when the
orphan terminates, it is the subreaper process that will
receive a SIGCHLD signal and will be able to wait(2) on the
process to discover its termination status.

-- http://man7.org/linux/man-pages/man2/prctl.2.html


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds