Standards / Extensions | C or C++ | Dependencies |
---|---|---|
XPG4.2 |
both |
#define _XOPEN_SOURCE_EXTENDED 1
#include <unistd.h>
pid_t getpgid(pid_t pid);
The getpgid() function returns the process group ID of the process whose process ID is equal to pid. If pid is 0, getpgid() returns the PID of the calling process.
If successful, getpgid() returns a process group ID.