1 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
3 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 .\" GNU General Public License for more details.
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, see
21 .\" <http://www.gnu.org/licenses/>.
24 .\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond <esr@y\thyrsus.com>
25 .\" Modified 2001-12-17, aeb
26 .TH GETSID 2 2010-09-26 "Linux" "Linux Programmer's Manual"
28 getsid \- get session ID
30 .B #include <unistd.h>
32 .BI "pid_t getsid(pid_t" " pid" );
35 Feature Test Macro Requirements for glibc (see
36 .BR feature_test_macros (7)):
43 _XOPEN_SOURCE\ >=\ 500 ||
44 _XOPEN_SOURCE\ &&\ _XOPEN_SOURCE_EXTENDED
46 || /* Since glibc 2.12: */ _POSIX_C_SOURCE\ >=\ 200809L
52 returns the session ID of the calling process.
54 returns the session ID of the process with process ID
56 (The session ID of a process is the process group ID of the
59 On success, a session ID is returned.
60 On error, \fI(pid_t)\ \-1\fP will be returned, and
66 A process with process ID
68 exists, but it is not in the same session as the calling process,
69 and the implementation considers this an error.
72 No process with process ID
76 This system call is available on Linux since version 2.0.
77 .\" Linux has this system call since Linux 1.3.44.
78 .\" There is libc support since libc 5.2.19.