1CTERMID(3) Linux Programmer's Manual CTERMID(3)
2
3
4
6 ctermid - get controlling terminal name
7
9 #include <stdio.h>
10
11 char *ctermid(char *s);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 ctermid(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
16
18 ctermid() returns a string which is the pathname for the current con‐
19 trolling terminal for this process. If s is NULL, a static buffer is
20 used, otherwise s points to a buffer used to hold the terminal path‐
21 name. The symbolic constant L_ctermid is the maximum number of charac‐
22 ters in the returned pathname.
23
25 The pointer to the pathname.
26
28 Svr4, POSIX.1-2001.
29
31 The path returned may not uniquely identify the controlling terminal;
32 it may, for example, be /dev/tty.
33
34 It is not assured that the program can open the terminal.
35
37 ttyname(3)
38
40 This page is part of release 3.22 of the Linux man-pages project. A
41 description of the project, and information about reporting bugs, can
42 be found at http://www.kernel.org/doc/man-pages/.
43
44
45
46GNU 2007-07-26 CTERMID(3)