#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:
See attributes(7) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|
|December 28, 1996||OmniOS|