Sujet : Re: Why does getppid() still return old parent pid after setsid()?
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.unix.programmerDate : 11. Nov 2024, 21:15:05
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vgtok9$br6j$1@news.xmission.com>
References : 1 2 3
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vgtdm4$11fog$2@dont-email.me>,
Lew Pitcher <
lew.pitcher@digitalfreehold.ca> wrote:
...
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"?
Yes, that's it. The man page text even includes the word 'reparented'.
Note; I've never actually used this call, but I can imagine situations
where it could be used. The man page seems pretty clear as to what it does.
-- The difference between communism and capitalism? In capitalism, man exploits man. In communism, it's the other way around. - Daniel Bell, The End of Ideology (1960) -