Open System Services System Calls Reference Manual (G06.25+, H06.03+)
System Functions (f - i) getpgid(2)
NAME
getpgid - Gets the process group ID for a specified OSS process
LIBRARY
G-series native OSS processes: /G/system/sysnn/zossksrl
H-series OSS processes: /G/system/zdllnnn/zosskdll
SYNOPSIS
#include <unistd.h>
pid_t getpgid(
pid_t pid);
PARAMETERS
pid Specifies the process ID of the target process. If the specified value is 0 (zero),
the target process is the calling process.
DESCRIPTION
The getpgid() function returns the process group ID of the process specified by the process ID
pid.
Use From the Guardian Environment
This function cannot be used in the Guardian environment. When the getpgid() function is
called from the Guardian environment, the call fails and errno is set to [ENOTOSS].
RETURN VALUES
The getpgid() function returns the process group ID of the specified process. If an error occurs,
the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of the following conditions occurs, the getpgid() function sets errno to the corresponding
value.
[EINVAL] The pid parameter is out of range.
[ENOTOSS] The calling process is not an OSS process. The requested operation is not sup-
ported from the Guardian environment.
[EPERM] The specified process is not in the same session as the calling process.
[ESRCH] The value of the pid parameter does not match the OSS process ID of the calling
process or of a child process of the calling process.
RELATED INFORMATION
Functions: exec(2), fork(2), getpgrp(2), setpgid(2), setsid(2), tcsetpgrp(2), tdm_execve(2),
tdm_execvep(2), tdm_fork(2), tdm_spawn(2), tdm_spawnp(2).
STANDARDS CONFORMANCE
The following is an HP extension to the XPG4 Version 2 specification:
• The function can return the errno value [ENOTOSS].
527186-003 Hewlett-Packard Company 3−43