ttyname, isatty, ttyslot - get name of associated terminal (tty) from
file descriptor
Standard C Library (libc, -lc)
#include <unistd.h>
char *
ttyname(int fd);
int
isatty(int fd);
#include <stdlib.h>
int
ttyslot();slot() function fetches the current process' control terminal number
from the ttys(5) file entry.
The ttyname() function returns the null terminated name if the device is
found and isatty() is true; otherwise a NULL pointer is returned and
errno is set to indicate the error..
ioctl(2), ttys(5)
The ttyname() and isatty() functions conform to ISO/IEC 9945-1:1990
(``POSIX.1'')..
BSD June 4, 1993 BSD