1ctermid(3)                 Library Functions Manual                 ctermid(3)
2
3
4

NAME

6       ctermid - get controlling terminal name
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <stdio.h>
13
14       char *ctermid(char *s);
15
16   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18       ctermid():
19           _POSIX_C_SOURCE
20

DESCRIPTION

22       ctermid()  returns  a string which is the pathname for the current con‐
23       trolling terminal for this process.  If s is NULL, a static  buffer  is
24       used,  otherwise  s  points to a buffer used to hold the terminal path‐
25       name.  The symbolic constant L_ctermid is the maximum number of charac‐
26       ters in the returned pathname.
27

RETURN VALUE

29       The pointer to the pathname.
30

ATTRIBUTES

32       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
33       tributes(7).
34
35       ┌────────────────────────────────────────────┬───────────────┬─────────┐
36Interface                                   Attribute     Value   
37       ├────────────────────────────────────────────┼───────────────┼─────────┤
38ctermid()                                   │ Thread safety │ MT-Safe │
39       └────────────────────────────────────────────┴───────────────┴─────────┘
40

STANDARDS

42       POSIX.1-2008.
43

HISTORY

45       POSIX.1-2001, Svr4.
46

BUGS

48       The  returned  pathname  may  not  uniquely  identify  the  controlling
49       terminal; it may, for example, be /dev/tty.
50
51       It is not assured that the program can open the terminal.
52

SEE ALSO

54       ttyname(3)
55
56
57
58Linux man-pages 6.05              2023-07-20                        ctermid(3)
Impressum