setpgid(2) DG/UX 5.4.2 setpgid(2)
NAME
setpgid - set process group ID for job control
SYNOPSIS
#include <sys/types.h>
int setpgid (pid, pgid)
pidt pid, pgid;
where:
pid The process id of the process whose process group id is to
be changed.
pgid The new process group id.
DESCRIPTION
The setpgid() function is used to either join an existing process
group or create a new process group within the session of the calling
process. The process group ID of a session leader shall not change.
Upon successful completion, the process group ID of the process with
a process ID that matches pid shall be set to pgid. As a special
case, if pid is zero, the process ID of the calling process shall be
used. Also, if pgid is zero, the process ID of the indicated process
shall be used.
RETURN VALUE
0 Successful completion.
-1 An error occurred. errno is set to indicate the error.
DIAGNOSTICS
If any of the following conditions occur, the setpgid() function
shall return -1 and set errno to the corresponding value:
EACCES The value of the pid argument matches the process ID of a
child process of the calling process and the child process
has successfully executed one of the exec() functions.
EINVAL The value of the pgid argument is less than zero or is not
a value supported by the implementation.
ENOSYS The setpgid() function is not supported by this
implementation.
EPERM The process indicated by the pid argument is a session
leader.
The value of the pid argument is valid but 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.
The value of the pgid argument does not match the process
ID of the process indicated by the pid argument and there
Licensed material--property of copyright holder(s) 1
setpgid(2) DG/UX 5.4.2 setpgid(2)
is no process with a process group ID that matches the
value of the pgid argument in the same session as the
calling process.
ESRCH The value of the pid argument does not match the process ID
of the calling process or of a child process of the calling
process.
SEE ALSO
exec(2), getpgrp(2), setsid(2), tcsetpgrp(3C).
COPYRIGHTS
Portions of this text are reprinted from IEEE Std 1003.1-1988,
Portable Operating System Interface for Computer Environment,
copyright © 1988 by the Institute of Electrical and Electronics
Engineers, Inc., with the permission of the IEEE Standards
Department. To purchase IEEE Standards, call 800/678-IEEE.
In the event of a discrepancy between the electronic and the original
printed version, the original version takes precedence.
STANDARDS
The setpgid() always behaves as if _POSIX_JOB_CONTROL were defined,
regardless of whether or not it is defined.
Licensed material--property of copyright holder(s) 2