setpgrp(2) setpgrp(2)NAME setpgrp - set process group ID SYNOPSIS int setpgrp() int setpgrp(pid,pgrp) int pid, pgrp; DESCRIPTION The first form of setpgrp sets the process group ID of the calling process to the process ID of the calling process and returns the new process group ID. The second form of setpgrp is available when the process has requested 4.2 BSD compatibility. setpgrp will then set 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 the user is not superuser, then the affected process must have the same effective user ID as the invoking user or be a descendant of the invoking process. STATUS MESSAGES AND VALUES Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned and errno is set to indicate the error. The setpgrp call fails if: ESRCH the process is not found. EPERM The caller is not superuser. SEE ALSO exec(2), fork(2), getpid(2), intro(2), kill(2), setcompat(2), signal(3) January 1992 1