JCSETPGRP(2P) JCSETPGRP(2P)
NAME
jcsetpgrp - set process group ID for job control
SYNOPSIS
int jcsetpgrp(pgrp)
int pgrp;
DESCRIPTION
jcsetpgrp sets the process group ID of the calling process
to pgrp. If pgrp is equal to the process ID of the calling
process, the calling process becomes a job control process
group leader unless the process is already the process group
leader.
jcsetpgrp is part of the POSIX Job Control Option.
RETURN VALUE
Upon successful completion, jcsetpgrp returns a value of
zero. Otherwise, a value of -1 is returned and errno is set
to indicate the error.
ERRORS
jcsetpgrp will fail if one or more of the following are
true:
[EINVAL] The value of pgrp is less than or equal to
zero or exceeds {PID_MAX}.
The calling process is the process group
leader and pgrp does not match the process ID.
[EPERM] The value of pgrp is greater than zero and
less than or equal to {PID_MAX} and there are
processes already in the process group
indicated by pgrp and none of these processes
have the same controlling terminal as the
calling process.
[ENOTTY] The calling process does not have a
controlling terminal.
Page 1 May 1989
JCSETPGRP(2P) JCSETPGRP(2P)
SEE ALSO
tcsetpgrp(3P).
Page 2 May 1989