Get the session ID of a process
#include <unistd.h> pid_t getsid( pid_t pid );
libc
The getsid() function determines the session ID for the given process ID, pid.
The session ID, or -1 if an error occurs (errno is set).
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | No |
| Signal handler | No |
| Thread | Yes |