Open System Services System Calls Reference Manual (G06.29+, H06.08+, J06.03+)

getsid(2) OSS System Calls Reference Manual
NAME
getsid - Gets the process group ID of the session leader
LIBRARY
G-series native OSS processes: system library
H-series and J-series OSS processes: implicit libraries
SYNOPSIS
#include <unistd.h>
pid_t getsid(
pid_t pid);
PARAMETERS
pid Specifies the OSS process ID of the target process. If the value specified is
pid_t(0) (an OSS process ID of zero), the function uses the OSS process ID of
the calling process.
DESCRIPTION
The getsid() function returns the process group ID of the process that is the session leader of the
process specified by the OSS process ID in the pid parameter. Specifying a pid of 0 (zero) returns
the process group ID of the calling process.
Use From the Guardian Environment
Calls to getsid() from Guardian processes are not successful because Guardian processes do not
have OSS process IDs. Such calls return an errno value of [ENOTOSS].
NOTES
On systems running H06.24 or later H-series RVUs or J06.13 or later J-series RVUs, you can use
this function with 32-bit or 64-bit OSS applications.
RETURN VALUES
Upon successful completion, the getsid() function returns the process group ID of the specified
process. If the function call fails, the value -1 is returned and errno is set to indicate the error.
ERRORS
If any of these conditions occurs, the getsid() function sets errno to the corresponding value:
[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, and the
calling process lacks sufcient privilege to read the specified process.
[ESRCH] No process has been found that has an OSS process ID identical to that specified
by the pid parameter.
RELATED INFORMATION
Functions: execl(2), execle(2), execlp(2), execv(2), execve(2), execvp(2), fork(2), setsid(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 errno value [ENOTOSS] can be returned.
384 Hewlett-Packard Company 527186-023