1SETPGRP(2)                    System Calls Manual                   SETPGRP(2)
2
3
4

NAME

6       setpgrp - set process group
7

SYNOPSIS

9       setpgrp(pid, pgrp)
10       int pid, pgrp;
11

DESCRIPTION

13       Setpgrp  sets  the  process  group  of the specified process pid to the
14       specified pgrp.  If pid is zero, then the call applies to  the  current
15       process.
16
17       If  the  invoker  is not the super-user, then the affected process must
18       have the same effective user-id as the invoker or be  a  descendant  of
19       the invoking process.
20

RETURN VALUE

22       Setpgrp  returns  when  the  operation  was successful.  If the request
23       failed, -1 is returned and the global variable errno indicates the rea‐
24       son.
25

ERRORS

27       Setpgrp  will  fail and the process group will not be altered if one of
28       the following occur:
29
30       [ESRCH]        The requested process does not exist.
31
32       [EPERM]        The effective user ID of the requested process  is  dif‐
33                      ferent  from that of the caller and the process is not a
34                      descendent of the calling process.
35

SEE ALSO

37       getpgrp(2)
38
39
40
414th Berkeley Distribution         May 9, 1985                       SETPGRP(2)
Impressum