]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/ctermid.3
des_crypt.3: Minor wording fix in VERSIONS
[thirdparty/man-pages.git] / man3 / ctermid.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
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.
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.
12 .\"
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.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Modified Sat Jul 24 19:51:06 1993 by Rik Faith (faith@cs.unc.edu)
26 .TH CTERMID 3 2019-03-06 "GNU" "Linux Programmer's Manual"
27 .SH NAME
28 ctermid \- get controlling terminal name
29 .SH SYNOPSIS
30 .nf
31 .B #include <stdio.h>
32 .\" POSIX also requires this function to be declared in <unistd.h>,
33 .\" and glibc does so if suitable feature test macros are defined.
34 .PP
35 .BI "char *ctermid(char *" "s" );
36 .fi
37 .PP
38 .in -4n
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
41 .in
42 .PP
43 .BR ctermid ():
44 _POSIX_C_SOURCE
45 .SH DESCRIPTION
46 .BR ctermid ()
47 returns a string which is the pathname for the current
48 controlling terminal for this process.
49 If
50 .I s
51 is NULL,
52 a static buffer is used, otherwise
53 .I s
54 points to a buffer used to hold the terminal pathname.
55 The symbolic constant
56 .B L_ctermid
57 is the maximum number of characters in the returned pathname.
58 .SH RETURN VALUE
59 The pointer to the pathname.
60 .SH ATTRIBUTES
61 For an explanation of the terms used in this section, see
62 .BR attributes (7).
63 .TS
64 allbox;
65 lb lb lb
66 l l l.
67 Interface Attribute Value
68 T{
69 .BR ctermid ()
70 T} Thread safety MT-Safe
71 .TE
72 .SH CONFORMING TO
73 POSIX.1-2001, POSIX.1-2008, Svr4.
74 .SH BUGS
75 The returned pathname may not uniquely identify the controlling
76 terminal; it may, for example, be
77 .IR /dev/tty .
78 .PP
79 It is not assured that the program can open the terminal.
80 .\" in glibc 2.3.x, x >= 4, the glibc headers threw an error
81 .\" if ctermid() was given an argument; fixed in 2.4.
82 .SH SEE ALSO
83 .BR ttyname (3)