Returns the process group ID of the calling process.
Standard C Library (libc.a)
#include <unistd.h>
pid_t getpgid (Pid)
(pid_ Pid)
The getpgid subroutine returns the process group ID of the process whose process ID is equal to that specified by the Pid parameter. If the value of the Pid parameter is equal to (pid_t)0, the getpgid subroutine returns the process group ID of the calling process.
Item | Description |
---|---|
Pid | The process ID of the process to return the process group ID for. |
Item | Description |
---|---|
id | The process group ID of the requested process |
-1 | Not successful and errno set to one of the following. |
Item | Description |
---|---|
ESRCH | There is no process with a process ID equal to Pid. |
Item | Description |
---|---|
EPERM | The process whose process ID is equal to Pid is not in the same session as the calling process. |
EINVAL | The value of the Pid argument is invalid. |