1 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH TCGETSID 3 2021-03-22 "Linux man-pages (unreleased)"
7 tcgetsid \- get session ID
10 .RI ( libc ", " \-lc )
13 .BR "#define _XOPEN_SOURCE 500" " /* See feature_test_macros(7) */"
14 .B "#include <termios.h>"
16 .BI "pid_t tcgetsid(int " fd );
21 returns the session ID of the current session that has the
22 terminal associated to
24 as controlling terminal.
25 This terminal must be the controlling terminal of the calling process.
29 refers to the controlling terminal of our session,
32 will return the session ID of this session.
33 Otherwise, \-1 is returned, and
35 is set to indicate the error.
40 is not a valid file descriptor.
43 The calling process does not have a controlling terminal, or
44 it has one but it is not described by
48 is provided in glibc since version 2.1.
50 For an explanation of the terms used in this section, see
58 Interface Attribute Value
61 T} Thread safety MT-Safe
67 POSIX.1-2001, POSIX.1-2008.
69 This function is implemented via the