TTYNAME(3) Library Functions Manual TTYNAME(3)
ttyname, isatty, ttyslot - find name of a terminal
Ttyname returns a pointer to the null-terminated path name of the ter-
minal device associated with file descriptor filedes (this is a system
file descriptor and has nothing to do with the standard I/O FILE type-
Isatty returns 1 if filedes is associated with a terminal device, 0
Ttyslot returns the number of the entry in the ttys(5) file for the
control terminal of the current process.
Ttyname returns a null pointer (0) if filedes does not describe a ter-
minal device in directory `/dev'.
Ttyslot returns 0 if `/etc/ttys' is inaccessible or if it cannot deter-
mine the control terminal.
The return value points to static data whose content is overwritten by
19 January 1983 TTYNAME(3)