Liste des Groupes | Revenir à cu programmer |
On 2024-11-08, Muttley@DastartdlyHQ.org <Muttley@DastartdlyHQ.org> wrote:I've tried this code on both MacOS and Linux yet the child process getppid()>
still returns its original parent process instead of "1" for init which is
what I'd expect. Isn't setsid() supposed to completely detach the child or
have I misunderstood?
No; it's because you put a 1 second delay into the parent to keep it
alive, whereas the child calls getppid() without any such timed
scheduling delay.
Les messages affichés proviennent d'usenet.