Commit | Line | Data |
---|---|---|
b0a4bad9 KM |
1 | .\" Copyright (c) 1983 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
fd690c8b | 5 | .\" @(#)getpgrp.2 6.3 (Berkeley) %G% |
b0a4bad9 | 6 | .\" |
588742b6 | 7 | .TH GETPGRP 2 "" |
b0a4bad9 KM |
8 | .UC 5 |
9 | .SH NAME | |
10 | getpgrp \- get process group | |
11 | .SH SYNOPSIS | |
12 | .ft B | |
13 | .nf | |
14 | pgrp = getpgrp(pid) | |
fd690c8b | 15 | int pgrp; |
b0a4bad9 KM |
16 | int pid; |
17 | .fi | |
18 | .ft R | |
19 | .SH DESCRIPTION | |
20 | The process group of the specified process is returned by | |
21 | .I getpgrp. | |
22 | If | |
23 | .I pid | |
24 | is zero, then the call applies to the current process. | |
25 | .PP | |
26 | Process groups are used for distribution of signals, and | |
27 | by terminals to arbitrate requests for their input: processes | |
214b5721 | 28 | that have the same process group as the terminal are foreground |
b0a4bad9 KM |
29 | and may read, while others will block with a signal if they attempt |
30 | to read. | |
31 | .PP | |
32 | This call is thus used by programs such as | |
33 | .IR csh (1) | |
34 | to create | |
35 | process groups | |
36 | in implementing job control. | |
37 | The TIOCGPGRP and TIOCSPGRP calls | |
38 | described in | |
39 | .IR tty (4) | |
40 | are used to get/set the process group of the control terminal. | |
41 | .SH "SEE ALSO" | |
42 | setpgrp(2), getuid(2), tty(4) |