ttyname(3C) 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.
RESULT
ttyname() returns a null pointer if fildes does not describe a termi-
nal device in directory /dev.
NOTES
The return value points to static data whose content is overwritten by
each call.
FILES
/dev/*
SEE ALSO
ttysrch(4).
Page 1 Reliant UNIX 5.44 Printed 11/98