setpgrp2(2) CLIX setpgrp2(2)
NAME
setpgrp2 - Sets process group
LIBRARY
Berkeley Software Distribution Library (libbsd.a)
SYNOPSIS
int setpgrp2(
int pid ,
int pgrp );
PARAMETERS
pid Represents the process identifier.
pgrp Represents the process group identifier.
DESCRIPTION
The setpgrp2() function sets the process group of the specified process
pid to the specified pgrp. If pid is 0, the call applies to the current
process.
If the caller is not the superuser, the affected process must have the
same effective user ID as the caller or be a descendant of the calling
process.
EXAMPLES
To make a child process part of a specified process group:
if (setpgrp2(child_pid, pgrp) != 0)
perror("setpgrp2 failed");
RETURN VALUES
Upon successful completion, a value of 0 is returned. Otherwise, a value
of -1 is returned and errno is set to indicate the error.
ERRORS
The setpgrp2() function fails and the process group is not altered if one
of the following occurs:
[ESRCH] The requested process does not exist.
[EPERM] The effective user ID of the requested process is different from
2/94 - Intergraph Corporation 1
setpgrp2(2) CLIX setpgrp2(2)
that of the caller and the process is not a descendent of the
calling process.
RELATED INFORMATION
Functions: getpgrp2(2), setpgrp(2), getpgrp(2), setpgid(2)
2 Intergraph Corporation - 2/94