2 .\" Copyright (C) 2002 Andries Brouwer <aeb@cwi.nl>
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .TH tcgetsid 3 (date) "Linux man-pages (unreleased)"
8 tcgetsid \- get session ID
11 .RI ( libc ", " \-lc )
14 .BR "#define _XOPEN_SOURCE 500" " /* See feature_test_macros(7) */"
15 .B "#include <termios.h>"
17 .BI "pid_t tcgetsid(int " fd );
22 returns the session ID of the current session that has the
23 terminal associated to
25 as controlling terminal.
26 This terminal must be the controlling terminal of the calling process.
30 refers to the controlling terminal of our session,
33 will return the session ID of this session.
34 Otherwise, \-1 is returned, and
36 is set to indicate the error.
41 is not a valid file descriptor.
44 The calling process does not have a controlling terminal, or
45 it has one but it is not described by
48 For an explanation of the terms used in this section, see
54 Interface Attribute Value
59 T} Thread safety MT-Safe
67 This function is implemented via the