]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/tcgetsid.3
All pages: Remove the 5th argument to .TH
[thirdparty/man-pages.git] / man3 / tcgetsid.3
1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
2 .\"
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
4 .\"
5 .TH TCGETSID 3 2021-03-22 "Linux man-pages (unreleased)"
6 .SH NAME
7 tcgetsid \- get session ID
8 .SH LIBRARY
9 Standard C library
10 .RI ( libc ", " \-lc )
11 .SH SYNOPSIS
12 .nf
13 .BR "#define _XOPEN_SOURCE 500" " /* See feature_test_macros(7) */"
14 .B "#include <termios.h>"
15 .PP
16 .BI "pid_t tcgetsid(int " fd );
17 .fi
18 .SH DESCRIPTION
19 The function
20 .BR tcgetsid ()
21 returns the session ID of the current session that has the
22 terminal associated to
23 .I fd
24 as controlling terminal.
25 This terminal must be the controlling terminal of the calling process.
26 .SH RETURN VALUE
27 When
28 .I fd
29 refers to the controlling terminal of our session,
30 the function
31 .BR tcgetsid ()
32 will return the session ID of this session.
33 Otherwise, \-1 is returned, and
34 .I errno
35 is set to indicate the error.
36 .SH ERRORS
37 .TP
38 .B EBADF
39 .I fd
40 is not a valid file descriptor.
41 .TP
42 .B ENOTTY
43 The calling process does not have a controlling terminal, or
44 it has one but it is not described by
45 .IR fd .
46 .SH VERSIONS
47 .BR tcgetsid ()
48 is provided in glibc since version 2.1.
49 .SH ATTRIBUTES
50 For an explanation of the terms used in this section, see
51 .BR attributes (7).
52 .ad l
53 .nh
54 .TS
55 allbox;
56 lbx lb lb
57 l l l.
58 Interface Attribute Value
59 T{
60 .BR tcgetsid ()
61 T} Thread safety MT-Safe
62 .TE
63 .hy
64 .ad
65 .sp 1
66 .SH STANDARDS
67 POSIX.1-2001, POSIX.1-2008.
68 .SH NOTES
69 This function is implemented via the
70 .B TIOCGSID
71 .BR ioctl (2),
72 present
73 since Linux 2.1.71.
74 .SH SEE ALSO
75 .BR getsid (2)