TTYNAME() UNIX System V TTYNAME()
Name
ttyname, isatty - find name of a terminal
Syntax
char *ttyname (fildes)
int fildes;
int isatty (fildes)
int fildes;
Description
The ttyname function 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.
Files
/dev/*
Diagnostics
The ttyname function returns a NULL pointer if fildes does
not describe a terminal device in directory /dev .
Note
The return value points to static data whose content is
overwritten by each call.
Standards Conformance
isatty and ttyname are conformant with:
AT&T SVID Issue 2, Select Code 307-127;
The X/Open Portability Guide II of January 1987;
IEEE POSIX Std 1003.1-1988 with C Standard Language-
Dependent System Support;
and NIST FIPS 151-1.
(printed 6/20/89)