TTYNAME(3C)
NAME
ttyname, isatty − find name of a terminal
SYNOPSIS
char ∗ttyname (fildes)
int fildes;
int isatty (fildes)
int fildes;
DESCRIPTION
Ttyname returns a pointer to a string containing the null-terminated path name of the terminal device associated with file descriptor fildes.
Isatty returns 1 if fildes is associated with a terminal device, 0 otherwise.
ERRORS
Isatty or ttyname will fail if any of the following is true:
[EBADF] The fildes argument is invalid.
[ENOTTY] An inappropriate I/O control operation has been attempted.
FILES
/dev/∗ /dev/pty/∗
DIAGNOSTICS
Ttyname returns a NULL pointer if fildes does not describe a terminal device in directory /dev.
WARNINGS
The return value points to static data whose content is overwritten by each call.
STANDARDS CONFORMANCE
ttyname: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1
isatty: SVID2, XPG2, XPG3, POSIX.1, FIPS 151-1
Hewlett-Packard Company — HP-UX Release 7.0: Sept 1989