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
14 ctermid() returns a string which is the pathname for the current con‐
15 trolling terminal for this process. If s is NULL, a static buffer is
16 used, otherwise s points to a buffer used to hold the terminal path‐
17 name. The symbolic constant L_ctermid is the maximum number of charac‐
18 ters in the returned pathname.
19
21 The pointer to the pathname.
22
24 Svr4, POSIX.1-2001.
25
27 The path returned may not uniquely identify the controlling terminal;
28 it may, for example, be /dev/tty.
29
30 It is not assured that the program can open the terminal.
31
33 ttyname(3)
34
35
36
37GNU 1993-04-06 CTERMID(3)