


TTYNAME(3V)            C LIBRARY FUNCTIONS            TTYNAME(3V)



NAME
     ttyname, isatty - find name of a terminal

SYNOPSIS
     char *ttyname(fd)
     int fd;

     int isatty(fd)
     int fd;

DESCRIPTION
     ttyname() returns a pointer to the null-terminated path name
     of the terminal device associated with file descriptor _f_d.

     isatty() returns 1 if _f_d is associated with a terminal  dev-
     ice, 0 otherwise.

FILES
     /dev/*

SEE ALSO
     ctermid(3V), ioctl(2), ttytab(5)

RETURN VALUES
     On success, ttyname() returns a pointer to the terminal dev-
     ice.  If _f_d does not describe a terminal device in directory
     /dev, ttyname() returns NULL.

     isatty() returns 1 if _f_d is associated with a terminal  dev-
     ice.  It returns 0 otherwise.

BUGS
     The return value points to static data which are overwritten
     by each call.





















Sun Release 4.1   Last change: 21 January 1990                  1



