.\" @(#)ttyname.3 6.1 (Berkeley) %G%
ttyname, isatty, ttyslot \- find name of a terminal
.B char *ttyname(filedes)
returns a pointer to the null-terminated path name
of the terminal device associated with file descriptor
(this is a system file descriptor and has nothing to do with the
standard I/O FILE typedef).
is associated with a terminal device, 0 otherwise.
returns the number of the entry in the
file for the control terminal of the current process.
returns a null pointer (0) if
does not describe a terminal device in directory `/dev'.
returns 0 if `/etc/ttys' is inaccessible or if
it cannot determine the control terminal.
The return value points to static data
whose content is overwritten by each call.