]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/tcgetsid.3
Added/updated glibc feature test macro requirements
[thirdparty/man-pages.git] / man3 / tcgetsid.3
1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .TH TCGETSID 3 2007-07-26 "GNU" "Linux Programmer's Manual"
24 .SH NAME
25 tcgetsid \- get session ID
26 .SH SYNOPSIS
27 .sp
28 .B #define _XOPEN_SOURCE 500
29 .br
30 .BR "#include <termios.h>"
31 .sp
32 .BI "pid_t tcgetsid(int " fd );
33 .SH DESCRIPTION
34 The function
35 .BR tcgetsid ()
36 returns the session ID of the current session that has the
37 terminal associated to
38 .I fd
39 as controlling terminal.
40 This terminal must be the controlling terminal of the calling process.
41 .SH "RETURN VALUE"
42 When
43 .I fd
44 refers to the controlling terminal of our session,
45 the function
46 .BR tcgetsid ()
47 will return the session ID of this session.
48 Otherwise, \-1 is returned, and
49 .I errno
50 is set appropriately.
51 .SH ERRORS
52 .TP
53 .B EBADF
54 .I fd
55 is not a valid file descriptor.
56 .TP
57 .B ENOTTY
58 The calling process does not have a controlling terminal, or
59 it has one but it is not described by
60 .IR fd .
61 .SH "CONFORMING TO"
62 POSIX.1-2001
63 .SH NOTES
64 This function is implemented via the
65 .B TIOCGSID
66 .BR ioctl (2),
67 present
68 since Linux 2.1.71.
69 .SH "SEE ALSO"
70 .BR getsid (2)