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 For an explanation of the terms used in this section, see
35 attributes(7).
36
37 ┌───────────┬───────────────┬─────────┐
38 │Interface │ Attribute │ Value │
39 ├───────────┼───────────────┼─────────┤
40 │tcgetsid() │ Thread safety │ MT-Safe │
41 └───────────┴───────────────┴─────────┘
43 POSIX.1-2001, POSIX.1-2008.
44
46 This function is implemented via the TIOCGSID ioctl(2), present since
47 Linux 2.1.71.
48
50 getsid(2)
51
53 This page is part of release 4.15 of the Linux man-pages project. A
54 description of the project, information about reporting bugs, and the
55 latest version of this page, can be found at
56 https://www.kernel.org/doc/man-pages/.
57
58
59
60GNU 2015-08-08 TCGETSID(3)