The process group of the current process is returned by
The process group of the process identified by
is returned by
returns the process group of the current process.
Process groups are used for distribution of signals, and
by terminals to arbitrate requests for their input: processes
that have the same process group as the terminal are foreground
and may read, while others will block with a signal if they attempt
This system call is thus used by programs such as
in implementing job control.
are used to get/set the process group of the control terminal.
system call always succeeds.
Upon successful completion, the
system call returns the process group of the specified process;
otherwise, it returns a value of -1 and sets
to indicate the error.
This version of
differs from past Berkeley versions by not taking a
Fa pid_t pid
This incompatibility is required by
St -p1003.1-90 .
system call that returns the process group ID for a specified process.
Although this function is used to support job control, all known
job-control shells always specify the calling process with this
Thus, the simpler
suffices, and the added complexity of the
has been omitted from POSIX.1.
The old functionality is available from the
will succeed unless:
Bq Er ESRCH
there is no process whose process ID equals