.\" Copyright (c) 1995 Jim Van Zandt .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License as .\" published by the Free Software Foundation; either version 2 of .\" the License, or (at your option) any later version. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public .\" License along with this manual; if not, write to the Free .\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, .\" USA. .\" .TH TTYNAME 3 "April 20, 1995" "Linux" "Linux Programmer's Manual" .SH NAME ttyname \- return name of a terminal .SH SYNOPSIS .ad l .nf .B #include .sp .BI "char *ttyname ( int " desc " );" .fi .ad b .SH DESCRIPTION Returns a pointer to the pathname of the terminal device that is open on the file descriptor \fIdesc\fP, or \fBNULL\fP on error (for example, if \fIdesc\fP is not connected to a terminal). .SH "CONFORMING TO" POSIX.1 .\" don't know about these: SVID, AT&T, X/OPEN, BSD 4.3 .SH "SEE ALSO" .BR fstat (2), .BR isatty (3)