[ Next Article |
Previous Article |
Book Contents |
Library Home |
Legal |
Search ]
Base Operating System and Extensions Technical Reference, Volume 1
getpgid Subroutine
Purpose
Returns the process group ID of the calling process.
Library
Standard C Library (libc.a)
Syntax
#include <unistd.h>
pid_t getpgid (Pid)
(pid_ Pid)
Description
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.
Parameter
Pid |
The process ID of the process to return the process group ID for. |
Return Values
id |
The process group ID of the requested process |
-1 |
Not successful and errno set to one of the following. |
Error Code
ESRCH |
There is no process with a process ID equal to Pid. |
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. |
Related Information
The exec subroutine, fork subroutine, getpid subroutine, getsid subroutine, setpgid subroutine, setsid subroutine.
[ Next Article |
Previous Article |
Book Contents |
Library Home |
Legal |
Search ]