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.
In order to get the session ID of a process outside the calling process's session, your process must have the PROCMGR_AID_GETID ability enabled. For more information, see procmgr_ability() .
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.
Last modified: 2013-12-23