Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

getsid - get process group ID

&pagelevel(4)&pagelevel

Syntax

#include <unistd.h>

pid_t getsid(pid_t pid); 

Description

The getsid() function returns the process group ID of the process that is session leaderof the process with the ID pid. If pid is (pid_t)0, then getsid() returns the session number of the calling process.

Return val.

Process group ID 



if successful.

 

(pid_t)-1

if an error occurs. errno is set to indicate the error.

Errors

getsid() will fail if:

EPERM

The process with the process ID pid is not in the same session as the calling process, and the implementation does not support access by the calling process to the session number of the specified process.

ESRCH

There is no process with the process ID pid.

See also

exec, fork(), getpid(), getpdig(), setpgid(), setsid(), unistd.h.