getpgid()

get process group ID 

Function


SYNOPSIS

#include <sys/types.h>

#include <unistd.h>

pid_t getpgid(pid_t pid);


DESCRIPTION

The getpgid() function returns the process group ID of the process whose process ID is equal to pid. Or, if pid is equal to zero, getpgid() returns the process group ID of the calling process.


PARAMETERS

pid 

Is the ID of process whose process ID is to be obtained.


RETURN VALUES

If successful, getpgid() returns a process group ID. On failure, it returns a value of -1 and sets errno to one of the following values:

ESRCH 

There is no process with a process ID equal to pid.


CONFORMANCE

UNIX 98


MULTITHREAD SAFETY LEVEL

Async-signal-safe.


PORTING ISSUES

getpgid() can only obtain the process group ID of a NuTCRACKER Platform process or of a Win32 process invoked by a NuTCRACKER Platform process. Otherwise, getpgid() returns -1, with errno set to ESRCH, even if the specified process ID is valid for a running Win32 process.

The returned process group ID is the Win32 process ID of the process group leader. Refer to Windows Concepts in the PTC MKS Toolkit UNIX to Windows Porting Guide for more information about process IDs.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
execl(), execle(), execlp(), execv(), execve(), execvp(), fork(), getpgrp(), getpid(), getsid(), setpgid(), setpgrp(), setsid()


PTC MKS Toolkit 10.4 Documentation Build 39.