3

I have a process P1 (child of some parent process P0) both in the same process group. P1 somewhere in his code runs: setpgid(0,0); then a new process group is created (where the group leader is P1).

  • Who is now P1's father: still P0, the session leader or some other?
3

Changing process groups has no effect on the process hierarchy. The parent is still P0.

It's important that the process hierarchy stays the same. When a shell implements job control, each job is put in its own process group. But the shell must still be the parent of the process group leader, so that the shell gets a SIGCHLD signal when it exits.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.