]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/ctermid.3
man*/: srcfix (Use .P instead of .PP or .LP)
[thirdparty/man-pages.git] / man3 / ctermid.3
CommitLineData
a1eaacb1 1'\" t
bf5a7247 2.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
fea681da 3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
c08df37a 5.\"
fea681da 6.\" Modified Sat Jul 24 19:51:06 1993 by Rik Faith (faith@cs.unc.edu)
4c1c5274 7.TH ctermid 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
8.SH NAME
9ctermid \- get controlling terminal name
b813014f
AC
10.SH LIBRARY
11Standard C library
12.RI ( libc ", " \-lc )
fea681da
MK
13.SH SYNOPSIS
14.nf
15.B #include <stdio.h>
b5a476b0
MK
16.\" POSIX also requires this function to be declared in <unistd.h>,
17.\" and glibc does so if suitable feature test macros are defined.
c6d039a3 18.P
fea681da
MK
19.BI "char *ctermid(char *" "s" );
20.fi
c6d039a3 21.P
d39ad78f 22.RS -4
cc4615cc
MK
23Feature Test Macro Requirements for glibc (see
24.BR feature_test_macros (7)):
d39ad78f 25.RE
c6d039a3 26.P
cc4615cc 27.BR ctermid ():
9d281e06 28.nf
1dd0d7b4 29 _POSIX_C_SOURCE
9d281e06 30.fi
fea681da 31.SH DESCRIPTION
63aa9df0 32.BR ctermid ()
c13182ef
MK
33returns a string which is the pathname for the current
34controlling terminal for this process.
fea681da
MK
35If
36.I s
8478ee02 37is NULL,
fea681da
MK
38a static buffer is used, otherwise
39.I s
40points to a buffer used to hold the terminal pathname.
41The symbolic constant
42.B L_ctermid
43is the maximum number of characters in the returned pathname.
47297adb 44.SH RETURN VALUE
fea681da 45The pointer to the pathname.
d768f1d9 46.SH ATTRIBUTES
93f0f908
PH
47For an explanation of the terms used in this section, see
48.BR attributes (7).
49.TS
50allbox;
c466875e 51lbx lb lb
93f0f908
PH
52l l l.
53Interface Attribute Value
54T{
9e54434e
BR
55.na
56.nh
d768f1d9 57.BR ctermid ()
d35f48a3 58T} Thread safety MT-Safe
93f0f908 59.TE
3113c7f3 60.SH STANDARDS
4131356c
AC
61POSIX.1-2008.
62.SH HISTORY
63POSIX.1-2001, Svr4.
fea681da 64.SH BUGS
590ba7e5 65The returned pathname may not uniquely identify the controlling
fea681da 66terminal; it may, for example, be
8478ee02 67.IR /dev/tty .
c6d039a3 68.P
fea681da 69It is not assured that the program can open the terminal.
f2665a55 70.\" in glibc 2.3.x, x >= 4, the glibc headers threw an error
b324e17d 71.\" if ctermid() was given an argument; fixed in glibc 2.4.
47297adb 72.SH SEE ALSO
fea681da 73.BR ttyname (3)