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

NAME

6       ttyname, isatty, ttyslot - find name of a terminal
7

SYNOPSIS

9       char *ttyname(filedes)
10
11       isatty(filedes)
12
13       ttyslot()
14

DESCRIPTION

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

FILES

28       /dev/∗
29       /etc/ttys
30

SEE ALSO

32       ioctl(2), ttys(5)
33

DIAGNOSTICS

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

BUGS

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)
Impressum