According to the
fork documentation (
man 2 fork):
The child process is an exact duplicate of the parent process except for the following points:
- The child has its own unique process ID, and this PID does not match the ID of any existing process group (setpgid(2)).
So, does this mean that two processes belonging to two different process groups can have the same PID? It makes no sense to me but
fork enforces that no new PID equals an existing PGID, and thus there could be a non-group leader process with same PID as the process newly created by fork, couldn't there?