1TCGETSID(3) Linux Programmer's Manual TCGETSID(3)
2
3
4
6 tcgetsid - get session ID
7
9 #define _XOPEN_SOURCE 500 /* See feature_test_macros(7) */
10 #include <termios.h>
11
12 pid_t tcgetsid(int fd);
13
15 The function tcgetsid() returns the session ID of the current session
16 that has the terminal associated to fd as controlling terminal. This
17 terminal must be the controlling terminal of the calling process.
18
20 When fd refers to the controlling terminal of our session, the function
21 tcgetsid() will return the session ID of this session. Otherwise, -1
22 is returned, and errno is set appropriately.
23
25 EBADF fd is not a valid file descriptor.
26
27 ENOTTY The calling process does not have a controlling terminal, or it
28 has one but it is not described by fd.
29
31 tcgetsid() is provided in glibc since version 2.1.
32
34 POSIX.1-2001.
35
37 This function is implemented via the TIOCGSID ioctl(2), present since
38 Linux 2.1.71.
39
41 getsid(2)
42
44 This page is part of release 3.53 of the Linux man-pages project. A
45 description of the project, and information about reporting bugs, can
46 be found at http://www.kernel.org/doc/man-pages/.
47
48
49
50GNU 2010-09-10 TCGETSID(3)