document that chroot doesn't change the current directory
[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.\"
16556f1d 5.\" @(#)setpgid.2 6.1 (Berkeley) %G%
3ebb09da 6.\"
16556f1d 7.TH SETPGRP 2 ""
3ebb09da
KM
8.UC 4
9.SH NAME
f4199a91 10setpgrp \- set process group
3ebb09da 11.SH SYNOPSIS
f4199a91
KM
12.ft B
13setpgrp(pid, pgrp)
14.br
15int pid, pgrp;
16.ft R
3ebb09da 17.SH DESCRIPTION
3ebb09da
KM
18.I Setpgrp
19sets the process group of the specified process
20.I pid
21to the specified
f4199a91 22.IR pgrp .
3ebb09da
KM
23If
24.I pid
25is zero, then the call applies to the current process.
26.PP
27If the invoker is not the super-user, then the affected process
28must have the same effective user-id as the invoker or be a descendant
29of the invoking process.
f4199a91
KM
30.SH "RETURN VALUE
31.I Setpgrp
32returns when the operation was successful. If
33the request failed, \-1 is returned and the global
34variable
35.I errno
36indicates the reason.
37.SH ERRORS
38.I Setpgrp
39will fail and the process group will not be altered if
40one of the following occur:
41.TP 15
42[ESRCH]
43The requested process does not exist.
44.TP 15
45[EPERM]
46The effective user ID of the requested process is different
47from that of the caller and the process is not a descendent
48of the calling process.
3ebb09da 49.SH "SEE ALSO"
f4199a91 50getpgrp(2)