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(fildes)
10
11       isatty(fildes)
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 fildes.
18
19       Isatty returns 1 if fildes is associated with a terminal device, 0 oth‐
20       erwise.
21
22       Ttyslot  returns  the  number  of the entry in the ttys(5) file for the
23       control terminal of the current process.
24

FILES

26       /dev/*
27       /etc/ttys
28

SEE ALSO

30       ioctl(2), ttys(5)
31

DIAGNOSTICS

33       Ttyname returns a null pointer (0) if fildes does not describe a termi‐
34       nal device in directory `/dev'.
35
36       Ttyslot returns 0 if `/etc/ttys' is inaccessible or if it cannot deter‐
37       mine the control terminal.
38

BUGS

40       The return value points to static data whose content is overwritten  by
41       each call.
42
43
44
45                                                                    TTYNAME(3)
Impressum