Get the session ID of a process
#include <unistd.h> pid_t getsid( pid_t pid );
- The process ID for the process whose session ID you want to get.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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).
- The process specified by pid isn't in the same session as the calling process, and the calling process doesn't have have the required permission; see procmgr_ability().
- There isn't a process with the given ID.