Sujet : Re: Why does getppid() still return old parent pid after setsid()?
De : lew.pitcher (at) *nospam* digitalfreehold.ca (Lew Pitcher)
Groupes : comp.unix.programmerDate : 11. Nov 2024, 18:08:20
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vgtdm4$11fog$2@dont-email.me>
References : 1 2
User-Agent : Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
On Sat, 09 Nov 2024 09:25:22 +0000, Kenny McCormack wrote:
[snip]
As
far as I know, in classic Unix, the only way for a process to get
"re-parented" is to have the parent die. Of course, as others have noted,
under Linux, there is also the re-parenting "prctl".
Kenny, could you elaborate on the use of prctl() to "reparent" a process?
I've not seen examples of how to do this, and the prctl(2) manpage doesn't
explicitly indicate the options necessary.
I don't see any option that controls or modifies a process PPID. The only
prctl(2) options that I can see relating to "reparenting" are the
PR_SET_CHILD_SUBREAPER and PR_GET_CHILD_SUBREAPER options that
seem to govern who gets SIGCHLD on the child's death. Is this what you
mean by "reparenting"?
[snip]
-- Lew Pitcher"In Skills We Trust"