ttyname(3) CLIX ttyname(3)
NAME
ttyname, isatty - Gets the name of a terminal
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
char *ttyname(
int file_descriptor );
int isatty(
int file_descriptor );
PARAMETERS
file_descriptor Specifies an open file descriptor.
DESCRIPTION
The ttyname() function returns a pointer to a string containing the null-
terminated pathname of the terminal device associated with file descriptor
specified by the file_descriptor parameter. A NULL pointer is returned if
the file descriptor does not describe a terminal device in the /dev
directory.
The return value of ttyname() points to static data that is overwritten by
each call.
The isatty() function determines if the device associated with the file
descriptor specified by the file_descriptor parameter is a terminal.
FILES
/dev/* Directory for device files.
RETURN VALUES
The ttyname() function returns a pointer to a string containing the null-
terminated pathname of the terminal device associated with
file_descriptor. A NULL pointer is returned if the file descriptor does
not describe a terminal device in the /dev directory.
The isatty() function returns a value of 1 if the specified file
descriptor is associated with a terminal. If the file descriptor is not
associated with a terminal, a value of 0 is returned.
RELATED INFORMATION
2/94 - Intergraph Corporation 1
ttyname(3) CLIX ttyname(3)
Functions: ttyslot(3)
2 Intergraph Corporation - 2/94