1TCGETSID(3) Linux Programmer's Manual TCGETSID(3)
2
3
4
6 tcgetsid - get session ID
7
9 #include <termios.h>
10
11 pid_t tcgetsid(int fd);
12
14 The function tcgetsid() returns the session ID of the current session
15 that has the terminal associated to fd as controlling terminal. This
16 terminal must be the controlling terminal of the calling process.
17
19 When fd refers to the controlling terminal of our session, the function
20 tcgetsid() will return the session ID of this session. Otherwise, -1
21 is returned, and errno is set appropriately.
22
24 EBADF fd is not a valid file descriptor.
25
26 ENOTTY The calling process does not have a controlling terminal, or it
27 has one but it is not described by fd.
28
30 This function is implemented via the TIOCGSID ioctl(), present since
31 Linux 2.1.71.
32
34 POSIX.1-2001
35
37 getsid(2)
38
39
40
41POSIX 2003-01-30 TCGETSID(3)