getsid()

get process group ID of session leader 

Function


SYNOPSIS

#include <sys/types.h>

#include <unistd.h>

pid_t getsid(pid_t pid);


DESCRIPTION

getsid() returns the process group ID of the process that is the session leader of the process whose process ID is equal to pid. If pid is 0, getpgid() returns the process group ID of the session leader of the calling process.


PARAMETERS

pid 

is the ID of the process whose session leader's process ID is to be obtained.


RETURN VALUES

If successful, getsid() 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

MT-Safe.


PORTING ISSUES

getsid() can only obtain the process group ID of a NuTCRACKER Platform process or of a Win32 process invoked by a NuTCRACKER Platform process. Otherwise, getsid() 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(), execvpe(), fork(), getpgid(), getpgrp(), getpid(), setpgid(), setpgrp(), setsid()


PTC MKS Toolkit 10.4 Documentation Build 39.