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