BSD 4_2 development
[unix-history] / usr / man / man2 / getpgrp.2
CommitLineData
69203019
C
1.TH GETPGRP 2 "2 July 1983"
2.UC 4
3.SH NAME
4getpgrp \- get process group
5.SH SYNOPSIS
6.ft B
7.nf
8pgrp = getpgrp(pid)
9int prgp;
10int pid;
11.fi
12.ft R
13.SH DESCRIPTION
14The process group of the specified process is returned by
15.I getpgrp.
16If
17.I pid
18is zero, then the call applies to the current process.
19.PP
20Process groups are used for distribution of signals, and
21by terminals to arbitrate requests for their input: processes
22which have the same process group as the terminal are foreground
23and may read, while others will block with a signal if they attempt
24to read.
25.PP
26This call is thus used by programs such as
27.IR csh (1)
28to create
29process groups
30in implementing job control.
31The TIOCGPGRP and TIOCSPGRP calls
32described in
33.IR tty (4)
34are used to get/set the process group of the control terminal.
35.SH "SEE ALSO"
36setpgrp(2), getuid(2), tty(4)