1GETSID(2) Linux Programmer's Manual GETSID(2)
2
3
4
6 getsid - get session ID
7
9 #include <unistd.h>
10
11 pid_t getsid(pid_t pid);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 getsid(): _XOPEN_SOURCE >= 500
16
18 getsid(0) returns the session ID of the calling process. getsid(p)
19 returns the session ID of the process with process ID p. (The session
20 ID of a process is the process group ID of the session leader.)
21
23 On success, a session ID is returned. On error, (pid_t) -1 will be
24 returned, and errno is set appropriately.
25
27 EPERM A process with process ID p exists, but it is not in the same
28 session as the calling process, and the implementation considers
29 this an error.
30
31 ESRCH No process with process ID p was found.
32
34 This system call is available on Linux since version 2.0.
35
37 SVr4, POSIX.1-2001.
38
40 Linux does not return EPERM.
41
43 getpgid(2), setsid(2), credentials(7)
44
46 This page is part of release 3.22 of the Linux man-pages project. A
47 description of the project, and information about reporting bugs, can
48 be found at http://www.kernel.org/doc/man-pages/.
49
50
51
52Linux 2008-12-05 GETSID(2)