1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" %%%LICENSE_START(VERBATIM)
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.
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.
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
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified Sat Jul 24 19:51:06 1993 by Rik Faith (faith@cs.unc.edu)
26 .TH CTERMID 3 2021-03-22 "GNU" "Linux Programmer's Manual"
28 ctermid \- get controlling terminal name
32 .\" POSIX also requires this function to be declared in <unistd.h>,
33 .\" and glibc does so if suitable feature test macros are defined.
35 .BI "char *ctermid(char *" "s" );
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
49 returns a string which is the pathname for the current
50 controlling terminal for this process.
54 a static buffer is used, otherwise
56 points to a buffer used to hold the terminal pathname.
59 is the maximum number of characters in the returned pathname.
61 The pointer to the pathname.
63 For an explanation of the terms used in this section, see
71 Interface Attribute Value
74 T} Thread safety MT-Safe
80 POSIX.1-2001, POSIX.1-2008, Svr4.
82 The returned pathname may not uniquely identify the controlling
83 terminal; it may, for example, be
86 It is not assured that the program can open the terminal.
87 .\" in glibc 2.3.x, x >= 4, the glibc headers threw an error
88 .\" if ctermid() was given an argument; fixed in 2.4.