Syntax | #include <unistd.h> Optional int setpgid(pid_t pid, pid_t pgid); | |
Description |
If pid is 0, the process ID of the calling process is used. If pgid is 0, the process group ID of the specified process is used. | |
Return val. | 0 -1 | if successful. if unsuccessful. |
Errors |
| |
|
| The value of pid matches the process ID of a child process of the calling process and the child process has successfully executed one of the |
|
| The value of pgid is less than 0 or not supported by the implementation. |
|
| The process specified by pid is a session leader, or the value of pid matches the process ID of a child process of the calling process and the child process is not in the same session as the calling process, or the value of pgid is valid but does not match the process ID of the process specified by pid, and there is no process with a process group ID that matches the value of pgid in the same session as the calling process. |
|
| The value of pid does not match the process ID of the calling process or of a child process of the calling process. |
See also |
|