ttyname(3)
NAME
ttyname, isatty, − find name of a terminal
SYNTAX
char *ttyname(fildes)
int fildes;
isatty(fildes)
int fildes;
DESCRIPTION
The ttyname subroutine returns a pointer to the null-terminated path name of the terminal device associated with file descriptor fildes.
The isatty returns 1 if fildes is associated with a terminal device, 0 otherwise.
FILES
/dev/*
/etc/ttys
RESTRICTIONS
The return value points to static data whose content is overwritten by each call.
DIAGNOSTICS
The ttyname subroutine returns a null pointer (0) if fildes does not describe a terminal device in the /dev directory.