Commit | Line | Data |
---|---|---|
3ebb09da KM |
1 | .\" Copyright (c) 1980 Regents of the University of California. |
2 | .\" All rights reserved. The Berkeley software License Agreement | |
3 | .\" specifies the terms and conditions for redistribution. | |
4 | .\" | |
5 | .\" @(#)setpgid.2 4.1 (Berkeley) %G% | |
6 | .\" | |
7 | .TH SETPGRP 2J | |
8 | .UC 4 | |
9 | .SH NAME | |
10 | setpgrp, getpgrp \- set/get process group | |
11 | .SH SYNOPSIS | |
12 | .B int getpgrp(pid) | |
13 | .PP | |
14 | .B setpgrp(pid, pgrp) | |
15 | .PP | |
16 | .B cc ... \-ljobs | |
17 | .SH DESCRIPTION | |
18 | The process group of the specified process is returned by | |
19 | .I getpgrp. | |
20 | .I Setpgrp | |
21 | sets the process group of the specified process | |
22 | .I pid | |
23 | to the specified | |
24 | .I pgrp. | |
25 | If | |
26 | .I pid | |
27 | is zero, then the call applies to the current process. | |
28 | .PP | |
29 | If the invoker is not the super-user, then the affected process | |
30 | must have the same effective user-id as the invoker or be a descendant | |
31 | of the invoking process. | |
32 | .PP | |
33 | This call is used by | |
34 | .IR csh (1) | |
35 | to create | |
36 | process groups | |
37 | in implementing job control. | |
38 | The TIOCGPGRP and TIOCSPGRP calls | |
39 | described in | |
40 | .IR tty (4) | |
41 | are used to get/set the process group of the control terminal. | |
42 | .PP | |
43 | See | |
44 | .IR jobs(3) | |
45 | for a general discussion of job control. | |
46 | .SH "SEE ALSO" | |
47 | jobs(3), getuid(2), tty(4) | |
48 | .SH BUGS | |
49 | The job control facilities are not available in standard version 7 UNIX. | |
50 | These facilities are still under development and may change in future | |
51 | releases of the system as better inter-process communication facilities | |
52 | and support for virtual terminals become available. The options and | |
53 | specifications of these system calls and even the calls themselves | |
54 | are thus subject to change. | |
55 | .PP | |
56 | A system call | |
57 | .I setpgrp | |
58 | has been implemented in other versions of UNIX which are not widely | |
59 | used outside of Bell Laboratories; these implementations | |
60 | have, in general, slightly different semantics. |