1 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
3 .\" This is free documentation; you can redistribute it and/or
4 .\" modify it under the terms of the GNU General Public License as
5 .\" published by the Free Software Foundation; either version 2 of
6 .\" the License, or (at your option) any later version.
8 .\" The GNU General Public License's references to "object code"
9 .\" and "executables" are to be interpreted as the output of any
10 .\" document formatting or typesetting system, including
11 .\" intermediate and printed output.
13 .\" This manual is distributed in the hope that it will be useful,
14 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
15 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 .\" GNU General Public License for more details.
18 .\" You should have received a copy of the GNU General Public
19 .\" License along with this manual; if not, write to the Free
20 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
23 .\" Modified Thu Oct 31 14:18:40 1996 by Eric S. Raymond <esr@y\thyrsus.com>
24 .\" Modified 2001-12-17, aeb
25 .TH GETSID 2 2007-07-26 "Linux" "Linux Programmer's Manual"
27 getsid \- get session ID
29 .B #include <unistd.h>
31 .BI "pid_t getsid(pid_t" " pid" );
34 Feature Test Macro Requirements for glibc (see
35 .BR feature_test_macros (7)):
39 _XOPEN_SOURCE\ >=\ 500
42 returns the session ID of the calling process.
44 returns the session ID of the process with process ID
46 (The session ID of a process is the process group ID of the
49 On success, a session ID is returned.
50 On error, \fI(pid_t)\ \-1\fP will be returned, and
56 A process with process ID
58 exists, but it is not in the same session as the current process,
59 and the implementation considers this an error.
62 No process with process ID
71 Linux has this system call since Linux 1.3.44.
72 There is libc support since libc 5.2.19.