Gets the process group ID for a process. This function is supported on OpenVMS Integrity servers and Alpha only. Format #include <unistd.h> pid_t getpgid (pid_t pid);
1 – Argument
pid The process ID for which the group ID is being requested.
2 – Description
The getpgid function returns the process group ID of the process specified by pid. If pid is 0, the getpgid function returns the process group ID of the calling process. This function requires that long (32-bit) UID/GID support be enabled. See 32-Bit UID and GID Macro (Integrity servers, Alpha) for more information.
3 – Return Values
x The process group ID of the session leader of the specified process. (pid_t)-1 Indicates an error. The function sets errno to one of the following values: o EPERM - The process specified by pid is not in the same session as the calling process, and the implementation does not allow access to the process group ID of that process from the calling process. o ESRCH - There is no process with a process ID of pid. o EINVAL - The value of pid is invalid.