getsid2
Get process session
Usage
#include <unistd.h>
pid_t
getsid(pid_t pid);
Library
Standard C Library (libc, -lc)
Overview
The session ID of the process identified by pid is returned by getsid(). If pid is zero, getsid() returns the session ID of the current process.
Return values
Upon successful completion, the function getsid() returns the session ID of the specified process; otherwise, it returns a value of -1 and sets errno to indicate an error.
Errors
The getsid() system call will fail if:
- [ESRCH]
-
There is no process with a process ID equal to pid.
Note that an implementation may restrict this function call to processes within the same session ID as the calling process.
Releases
147 releases since Mac OS X 10.2; the text changed 1 time.