Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail From: gazelle@shell.xmission.com (Kenny McCormack) Newsgroups: comp.unix.programmer Subject: Re: Why does getppid() still return old parent pid after setsid()? Date: Mon, 11 Nov 2024 20:15:05 -0000 (UTC) Organization: The official candy of the new Millennium Message-ID: References: Injection-Date: Mon, 11 Nov 2024 20:15:05 -0000 (UTC) Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4"; logging-data="388307"; mail-complaints-to="abuse@xmission.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: gazelle@shell.xmission.com (Kenny McCormack) Bytes: 1924 Lines: 22 In article , Lew Pitcher 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) -