The setpgid() function sets the process group ID of the process with ID pid to pgid.
If pgid is equal to pid, the process becomes a process group leader. See intro(2) for more information on session leaders and process group leaders.
If pgid is not equal to pid, the process becomes a member of an existing process group.
If pid is equal to 0, the process ID of the calling process is used. If pgid is equal to 0, the process specified by pid becomes a process group leader.
|