getsid(2) System Calls Manual getsid(2) getsid - ID LIBRARY Standard C library (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 ; GNU 3 , . . , , . Linux man-pages 6.06 31 2023 . getsid(2)