use isinf(3) and isnan(3) instead of rolling our own
[unix-history] / usr / src / lib / libc / sys / setpgid.2
CommitLineData
931b8415
CL
1.\" Copyright (c) 1980, 1991 Regents of the University of California.
2.\" All rights reserved.
3ebb09da 3.\"
931b8415 4.\" %sccs.include.redist.man%
3ebb09da 5.\"
931b8415
CL
6.\" @(#)setpgid.2 6.3 (Berkeley) %G%
7.\"
8.Dd
9.Dt SETPGID 2
10.Os BSD 4
11.Sh NAME
12.Nm setpgid ,
13.Nm setpgrp
14.Nd set process group
15.Sh SYNOPSIS
16.Fd #include <unistd.h>
17.Ft int
18.Fn setpgid pid_tpid pid_tpgrp
19.Ft int
20.Fn setpgrp pid_tpid pid_tpgrp
21.Sh DESCRIPTION
22.Fn Setpgid
3ebb09da 23sets the process group of the specified process
931b8415 24.Ar pid
3ebb09da 25to the specified
931b8415 26.Ar pgrp .
3ebb09da 27If
931b8415 28.Ar pid
3ebb09da 29is zero, then the call applies to the current process.
931b8415 30.Pp
3ebb09da
KM
31If the invoker is not the super-user, then the affected process
32must have the same effective user-id as the invoker or be a descendant
33of the invoking process.
931b8415
CL
34.Sh RETURN VALUES
35.Fn Setpgid
76559d79 36returns 0 when the operation was successful.
931b8415
CL
37If the request failed, -1 is returned and the global variable
38.Va errno
f4199a91 39indicates the reason.
931b8415
CL
40.Sh ERRORS
41.Fn Setpgid
42will fail and the process group will not be altered if:
43.Bl -tag -width indent
44.It Bq Er ESRCH
f4199a91 45The requested process does not exist.
931b8415 46.It Bq Er EPERM
f4199a91
KM
47The effective user ID of the requested process is different
48from that of the caller and the process is not a descendent
49of the calling process.
931b8415
CL
50.El
51.Sh SEE ALSO
52.Xr getpgrp 2
53.Sh STANDARDS
54.Fn Setpgid
55conforms to IEEE Std 1003.1-1988
56.Pq Dq Tn POSIX .
57.Sh COMPATIBILITY
58.Fn Setpgrp
76559d79 59is identical to
931b8415 60.Fn setpgid ,
76559d79 61and is retained for calling convention compatibility with historical
931b8415
CL
62versions of
63.Bx .