setpgid() sets the process group of the specified process
pid to the specified
pgrp. If
pid is zero, then the call applies to the current process. If
pgrp is zero, then the process id of the process specified by
pid is used instead.
If the invoker is not the super-user, then the affected process must have the same effective user-id as the invoker or be a descendant of the invoking process.