NAME | SYNOPSIS | LIBRARY | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO | STANDARDS | COMPATIBILITY
#include <unistd.h>pid_t setpgid(pid_t pid, pid_t pgrp);
Standard C Library (libc, -lc)
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The setpgid() function sets the process group of the specified pid to the specified pgrp . If pid is zero, setpgid() applies to the current process.
If the invoker is not the super-user, then the affected process must have the same effective user-id as the invoker or be a descendant of the invoking process.
The setpgid() function returns 0 when the operation was successful. If the request failed, -1 is returned and the global variable errno indicates the reason.
The setpgid() function will fail and the process group will not be altered if:
The requested process does not exist.
The effective user ID of the requested process is different from that of the caller and the process is not a descendent of the calling process.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
The setpgid() function call is expected to conform to ISO/IEC 9945-1:1990 (``POSIX.1'').
The setpgrp() is identical to setpgid() .
NAME | SYNOPSIS | LIBRARY | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ERRORS | ATTRIBUTES | SEE ALSO | STANDARDS | COMPATIBILITY