]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ctermid.3
Removed trailing white space at end of lines
[thirdparty/man-pages.git] / man3 / ctermid.3
CommitLineData
bf5a7247 1.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
fea681da 2.\"
93015253 3.\" %%%LICENSE_START(VERBATIM)
fea681da
MK
4.\" Permission is granted to make and distribute verbatim copies of this
5.\" manual provided the copyright notice and this permission notice are
6.\" preserved on all copies.
7.\"
8.\" Permission is granted to copy and distribute modified versions of this
9.\" manual under the conditions for verbatim copying, provided that the
10.\" entire resulting derived work is distributed under the terms of a
11.\" permission notice identical to this one.
c13182ef 12.\"
fea681da
MK
13.\" Since the Linux kernel and libraries are constantly changing, this
14.\" manual page may be incorrect or out-of-date. The author(s) assume no
15.\" responsibility for errors or omissions, or for damages resulting from
16.\" the use of the information contained herein. The author(s) may not
17.\" have taken the same level of care in the production of this manual,
18.\" which is licensed free of charge, as they might when working
19.\" professionally.
c13182ef 20.\"
fea681da
MK
21.\" Formatted or processed versions of this manual, if unaccompanied by
22.\" the source, must acknowledge the copyright and authors of this work.
4b72fb64 23.\" %%%LICENSE_END
c08df37a 24.\"
fea681da 25.\" Modified Sat Jul 24 19:51:06 1993 by Rik Faith (faith@cs.unc.edu)
9ba01802 26.TH CTERMID 3 2019-03-06 "GNU" "Linux Programmer's Manual"
fea681da
MK
27.SH NAME
28ctermid \- get controlling terminal name
29.SH SYNOPSIS
30.nf
31.B #include <stdio.h>
b5a476b0
MK
32.\" POSIX also requires this function to be declared in <unistd.h>,
33.\" and glibc does so if suitable feature test macros are defined.
68e4db0a 34.PP
fea681da
MK
35.BI "char *ctermid(char *" "s" );
36.fi
68e4db0a 37.PP
cc4615cc
MK
38.in -4n
39Feature Test Macro Requirements for glibc (see
40.BR feature_test_macros (7)):
41.in
68e4db0a 42.PP
cc4615cc 43.BR ctermid ():
cff459de 44_POSIX_C_SOURCE
fea681da 45.SH DESCRIPTION
63aa9df0 46.BR ctermid ()
c13182ef
MK
47returns a string which is the pathname for the current
48controlling terminal for this process.
fea681da
MK
49If
50.I s
8478ee02 51is NULL,
fea681da
MK
52a static buffer is used, otherwise
53.I s
54points to a buffer used to hold the terminal pathname.
55The symbolic constant
56.B L_ctermid
57is the maximum number of characters in the returned pathname.
47297adb 58.SH RETURN VALUE
fea681da 59The pointer to the pathname.
d768f1d9 60.SH ATTRIBUTES
93f0f908
PH
61For an explanation of the terms used in this section, see
62.BR attributes (7).
63.TS
64allbox;
65lb lb lb
66l l l.
67Interface Attribute Value
68T{
d768f1d9 69.BR ctermid ()
d35f48a3 70T} Thread safety MT-Safe
93f0f908 71.TE
47297adb 72.SH CONFORMING TO
20379f08 73POSIX.1-2001, POSIX.1-2008, Svr4.
fea681da 74.SH BUGS
590ba7e5 75The returned pathname may not uniquely identify the controlling
fea681da 76terminal; it may, for example, be
8478ee02 77.IR /dev/tty .
fea681da
MK
78.PP
79It is not assured that the program can open the terminal.
f2665a55 80.\" in glibc 2.3.x, x >= 4, the glibc headers threw an error
3f1c1b0a 81.\" if ctermid() was given an argument; fixed in 2.4.
47297adb 82.SH SEE ALSO
fea681da 83.BR ttyname (3)