ttyname(3C)
NAME
ttyname(), isatty() − find name of a terminal
SYNOPSIS
#include <unistd.h>
char *ttyname(int fildes);
int isatty(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.
RETURN VALUE
ttyname() returns a NULL pointer if fildes does not describe a terminal device in directory /dev.
ERRORS
isatty() and ttyname() fail if any of the following conditions are encountered:
[EBADF] The fildes argument is invalid.
[ENOTTY] An inappropriate I/O control operation has been attempted.
WARNINGS
The return value points to static data whose content is overwritten by each call.
FILES
/dev/*
/dev/pty/*
STANDARDS CONFORMANCE
ttyname(): AES, SVID2, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
isatty(): AES, SVID2, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
Hewlett-Packard Company — HP-UX Release 9.0: August 1992