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