]>
Commit | Line | Data |
---|---|---|
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) |
97986708 | 26 | .TH CTERMID 3 2016-03-15 "GNU" "Linux Programmer's Manual" |
fea681da MK |
27 | .SH NAME |
28 | ctermid \- 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 |
39 | Feature 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 |
47 | returns a string which is the pathname for the current |
48 | controlling terminal for this process. | |
fea681da MK |
49 | If |
50 | .I s | |
8478ee02 | 51 | is NULL, |
fea681da MK |
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. | |
47297adb | 58 | .SH RETURN VALUE |
fea681da | 59 | The pointer to the pathname. |
d768f1d9 | 60 | .SH ATTRIBUTES |
93f0f908 PH |
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{ | |
d768f1d9 | 69 | .BR ctermid () |
d35f48a3 | 70 | T} Thread safety MT-Safe |
93f0f908 | 71 | .TE |
47297adb | 72 | .SH CONFORMING TO |
20379f08 | 73 | POSIX.1-2001, POSIX.1-2008, Svr4. |
fea681da | 74 | .SH BUGS |
590ba7e5 | 75 | The returned pathname may not uniquely identify the controlling |
fea681da | 76 | terminal; it may, for example, be |
8478ee02 | 77 | .IR /dev/tty . |
fea681da MK |
78 | .PP |
79 | It 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) |