| Deutsch English Français Italiano |
|
<vgtdm4$11fog$2@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lew Pitcher <lew.pitcher@digitalfreehold.ca> Newsgroups: comp.unix.programmer Subject: Re: Why does getppid() still return old parent pid after setsid()? Date: Mon, 11 Nov 2024 17:08:20 -0000 (UTC) Organization: A noiseless patient Spider Lines: 23 Message-ID: <vgtdm4$11fog$2@dont-email.me> References: <vgl8h1$385vs$1@dont-email.me> <vgn9q2$8mls$1@news.xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 11 Nov 2024 18:08:21 +0100 (CET) Injection-Info: dont-email.me; posting-host="090d5a8025b43e616f11aef0313ce297"; logging-data="1097488"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+qLfQNWo8kgvybUolaBdaWIpBwGgTbRW4=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:rRtlk2JjvHiI3ClnHrDDFHmLApk= Bytes: 1873 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"