GETPGRP(2) COMMAND REFERENCE GETPGRP(2)
NAME
getpgrp - get process group
SYNOPSIS
pgrp = getpgrp(pid)
int pgrp;
int pid;
DESCRIPTION
Getpgrp returns the process group of the process specified
by pid in pgrp. If pid is zero, then the call applies to the
current process.
Process groups are used for distribution of signals, and by
terminals to arbitrate requests for their input; processes
which have the same process group as the terminal are
foreground and may read, while others will block with a
signal if they attempt to read.
This call is thus used by programs such as csh(1csh) to
create process groups in implementing job control. The
TIOCGPGRP and TIOCSPGRP calls described in tty(4) are used
to get/set the process group of the control terminal.
DIAGNOSTICS
Getpgrp will fail if the following is true:
[ESRCH] Pid is an invalid process ID.
RETURN VALUE
Upon successful completion, getpgrp returns the process
group in pgrp. If an error occurs, -1 is returned and errno
is set to indicate the error.
SEE ALSO
getuid(2), setpgrp(2), and tty(4).
Printed 4/6/89 1
%%index%%
na:312,79;
sy:391,464;
de:855,920;
di:1775,297;
rv:2072,373;
se:2445,173;
%%index%%000000000107