'\"macro stdmacro
.if n .pH g3c.ttyname @(#)ttyname	40.10 of 10/27/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} ttyname 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} ttyname 3C "C Programming Language Utilities"
.if \nX=2 .ds x} ttyname 3C "" "\&"
.if \nX=3 .ds x} ttyname "" "" "\&"
.TH \*(x}
.SH NAME
\f4ttyname\f1, \f4isatty\f1 \- find name of a terminal
.SH SYNOPSIS
\f4#include <stdlib.h>\fP
.PP
\f4char \(**ttyname (int fildes);\f1
.PP
\f4int isatty (int fildes);\f1
.SH DESCRIPTION
\f4ttyname\fP
returns a pointer to a string containing the null-terminated path name
of the terminal device associated with file descriptor
.IR fildes .
.PP
\f4isatty\fP
returns 1 if
.I fildes\^
is associated with a terminal device, 0 otherwise.
.SH FILES
\f4/dev/\(**\f1
.SH DIAGNOSTICS
\f4ttyname\fP
returns a
\f4NULL\fP
pointer if
.I fildes\^
does not describe a terminal device in directory
\f4/dev\f1.
.SH NOTES
The return value points to static data
whose content is overwritten by each call.
.\"	@(#)ttyname.3c	6.2 of 10/20/83
.Ee
