SETPGID(2P) SETPGID(2P)
NAME
setpgid - Set process group ID for job control.
SYNOPSIS
init setpgid (pid, pgid)
init pid, pgid;.
DESCRIPTION
The setpgid function is used to either create a new process
group or move the calling process or one of it's children
into an already existing process group.
Upon successful completion, the process group ID of the
process with a process ID which matches pid is set to pgid.
If pid is zero, the pid of the calling process is used for
pid. If pgid is set to 0, pid is used for pgid. Setpgid
will not set the process group ID for process pid equal to
pgid if one of the following are true:
[EACCESS]
pid matches the process ID of a child process of the
calling process which has successfully completed an
exec(2) call.
[EINVAL]
pgid does not fall within the range of valid process
group ID numbers.
[EPERM]
pid matches the process ID of a session leader, or pid
matches the process ID of a child of the calling
process which does not belong to the calling processes
session, or there is no process with a process ID which
matches the pgid argument within the session of the
calling process.
[ESRCH]
pid does not match the process ID of the calling
process or the process ID of a child of the calling
process.
Page 1 May 1989
SETPGID(2P) SETPGID(2P)
DIAGNOSTICS
Upon successful completion, a value of 0 is returned.
Otherwise, a value of -1 is returned and errno is set to
indicate the errorl.
SEE ALSO
intro(2), exec(2), exit(2), fork(2), getpid(2), kill(2),
sigaction(2), setsid(2), and terminos(7).
Page 2 May 1989