manual page distributed with 4.1BSD
[unix-history] / usr / src / lib / libc / sys / setpgid.2
CommitLineData
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
10setpgrp, 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
18The process group of the specified process is returned by
19.I getpgrp.
20.I Setpgrp
21sets the process group of the specified process
22.I pid
23to the specified
24.I pgrp.
25If
26.I pid
27is zero, then the call applies to the current process.
28.PP
29If the invoker is not the super-user, then the affected process
30must have the same effective user-id as the invoker or be a descendant
31of the invoking process.
32.PP
33This call is used by
34.IR csh (1)
35to create
36process groups
37in implementing job control.
38The TIOCGPGRP and TIOCSPGRP calls
39described in
40.IR tty (4)
41are used to get/set the process group of the control terminal.
42.PP
43See
44.IR jobs(3)
45for a general discussion of job control.
46.SH "SEE ALSO"
47jobs(3), getuid(2), tty(4)
48.SH BUGS
49The job control facilities are not available in standard version 7 UNIX.
50These facilities are still under development and may change in future
51releases of the system as better inter-process communication facilities
52and support for virtual terminals become available. The options and
53specifications of these system calls and even the calls themselves
54are thus subject to change.
55.PP
56A system call
57.I setpgrp
58has been implemented in other versions of UNIX which are not widely
59used outside of Bell Laboratories; these implementations
60have, in general, slightly different semantics.