1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Modified Sat Jul 24 19:51:06 1993 by Rik Faith (faith@cs.unc.edu)
6 .TH ctermid 3 (date) "Linux man-pages (unreleased)"
8 ctermid \- get controlling terminal name
11 .RI ( libc ", " \-lc )
15 .\" POSIX also requires this function to be declared in <unistd.h>,
16 .\" and glibc does so if suitable feature test macros are defined.
18 .BI "char *ctermid(char *" "s" );
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
32 returns a string which is the pathname for the current
33 controlling terminal for this process.
37 a static buffer is used, otherwise
39 points to a buffer used to hold the terminal pathname.
42 is the maximum number of characters in the returned pathname.
44 The pointer to the pathname.
46 For an explanation of the terms used in this section, see
54 Interface Attribute Value
57 T} Thread safety MT-Safe
63 POSIX.1-2001, POSIX.1-2008, Svr4.
65 The returned pathname may not uniquely identify the controlling
66 terminal; it may, for example, be
69 It is not assured that the program can open the terminal.
70 .\" in glibc 2.3.x, x >= 4, the glibc headers threw an error
71 .\" if ctermid() was given an argument; fixed in 2.4.