SETPGID(2) | System Calls | SETPGID(2) |
setpgid - set process group ID
#include <sys/types.h> #include <unistd.h> int setpgid(pid_t pid, pid_t pgid);
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.
Upon successful completion, 0 is returned. Otherwise, −1 is returned and errno is set to indicate the error.
The setpgid() function will fail if:
EACCES
EINVAL
EPERM
EPERM
EPERM
ESRCH
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Standard |
MT-Level | Async-Signal-Safe |
Intro(2), exec(2), exit(2), fork(2), getpid(2), getsid(2), attributes(7), standards(7)
December 28, 1996 | OmniOS |