getsid(2) System Calls Manual getsid(2) getsid - ID C (libc, -lc) #include pid_t getsid(pid_t pid); glibc (. feature_test_macros(7)): getsid(): _XOPEN_SOURCE >= 500 || /* glibc 2.12: */ _POSIX_C_SOURCE >= 200809L getsid() ID pid. pid 0, getsid() . On success, a session ID is returned. On error, (pid_t) -1 is returned, and errno is set to indicate the error. EPERM pid , ; . ESRCH pid . Linux EPERM. POSIX.1-2008. POSIX.1-2001, SVr4. Linux 2.0. credentials(7) . getpgid(2), setsid(2), credentials(7) () Azamat Hackimov , Dmitry Bolkhovskikh , Vladislav , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 2 2024 . getsid(2)