]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl> |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da | 24 | .\" |
460495ca | 25 | .TH TCGETSID 3 2015-08-08 "GNU" "Linux Programmer's Manual" |
fea681da MK |
26 | .SH NAME |
27 | tcgetsid \- get session ID | |
28 | .SH SYNOPSIS | |
86b91fdf | 29 | .BR "#define _XOPEN_SOURCE 500" " /* See feature_test_macros(7) */" |
cc4615cc | 30 | .br |
0daa9e92 | 31 | .B "#include <termios.h>" |
68e4db0a | 32 | .PP |
fea681da MK |
33 | .BI "pid_t tcgetsid(int " fd ); |
34 | .SH DESCRIPTION | |
35 | The function | |
63aa9df0 | 36 | .BR tcgetsid () |
fea681da MK |
37 | returns the session ID of the current session that has the |
38 | terminal associated to | |
39 | .I fd | |
40 | as controlling terminal. | |
41 | This terminal must be the controlling terminal of the calling process. | |
47297adb | 42 | .SH RETURN VALUE |
fea681da MK |
43 | When |
44 | .I fd | |
45 | refers to the controlling terminal of our session, | |
46 | the function | |
63aa9df0 | 47 | .BR tcgetsid () |
fea681da MK |
48 | will return the session ID of this session. |
49 | Otherwise, \-1 is returned, and | |
50 | .I errno | |
51 | is set appropriately. | |
52 | .SH ERRORS | |
53 | .TP | |
54 | .B EBADF | |
55 | .I fd | |
56 | is not a valid file descriptor. | |
57 | .TP | |
58 | .B ENOTTY | |
59 | The calling process does not have a controlling terminal, or | |
60 | it has one but it is not described by | |
61 | .IR fd . | |
c343e74c MK |
62 | .SH VERSIONS |
63 | .BR tcgetsid () | |
64 | is provided in glibc since version 2.1. | |
87a77f93 | 65 | .SH ATTRIBUTES |
1d40db1e PH |
66 | For an explanation of the terms used in this section, see |
67 | .BR attributes (7). | |
68 | .TS | |
69 | allbox; | |
70 | lb lb lb | |
71 | l l l. | |
72 | Interface Attribute Value | |
73 | T{ | |
87a77f93 | 74 | .BR tcgetsid () |
1d40db1e PH |
75 | T} Thread safety MT-Safe |
76 | .TE | |
47297adb | 77 | .SH CONFORMING TO |
89e88474 | 78 | POSIX.1-2001, POSIX.1-2008. |
fea681da | 79 | .SH NOTES |
097585ed MK |
80 | This function is implemented via the |
81 | .B TIOCGSID | |
fb186734 | 82 | .BR ioctl (2), |
1e321034 | 83 | present |
fea681da | 84 | since Linux 2.1.71. |
47297adb | 85 | .SH SEE ALSO |
fea681da | 86 | .BR getsid (2) |