Set the process group of the calling process.
Syntax
#include <unistd.h>
int setpgid (pid_t pid, pid_t pgid);
Parameters
-
pidThe PID to set the group ID for. If zero, the current process ID is used.
-
pgidThe process group ID to set. If zero, the group id is set to the PID value.
Return Value
The return value is zero if successful. Otherwise, the return value is negative.
-
EINVAL
One or both of the arguments are negative.
-
EACCES
The supplied PID is not the one of the calling process.
-
ESRCH
No such process.
Remarks
None