1TTYNAME(3) Library Functions Manual TTYNAME(3)
2
3
4
6 ttyname, isatty, ttyslot - find name of a terminal
7
9 char *ttyname(filedes)
10
11 isatty(filedes)
12
13 ttyslot()
14
16 Ttyname returns a pointer to the null-terminated path name of the ter‐
17 minal device associated with file descriptor filedes (this is a system
18 file descriptor and has nothing to do with the standard I/O FILE type‐
19 def).
20
21 Isatty returns 1 if filedes is associated with a terminal device, 0
22 otherwise.
23
24 Ttyslot returns the number of the entry in the ttys(5) file for the
25 control terminal of the current process.
26
28 /dev/∗
29 /etc/ttys
30
32 ioctl(2), ttys(5)
33
35 Ttyname returns a null pointer (0) if filedes does not describe a ter‐
36 minal device in directory `/dev'.
37
38 Ttyslot returns 0 if `/etc/ttys' is inaccessible or if it cannot deter‐
39 mine the control terminal.
40
42 The return value points to static data whose content is overwritten by
43 each call.
44
45
46
477th Edition May 15, 1985 TTYNAME(3)