4.3BSD-UWisc/man/cat3/ttyname.3

Compare this file to the similar file:
Show the results in this format:




TTYNAME(3)          UNIX Programmer's Manual           TTYNAME(3)



NAME
     ttyname, isatty, ttyslot - find name of a terminal

SYNOPSIS
     char *ttyname(filedes)

     isatty(filedes)

     ttyslot()

DESCRIPTION
     _T_t_y_n_a_m_e returns a pointer to the null-terminated path name
     of the terminal device associated with file descriptor
     _f_i_l_e_d_e_s (this is a system file descriptor and has nothing to
     do with the standard I/O FILE typedef).

     _I_s_a_t_t_y returns 1 if _f_i_l_e_d_e_s is associated with a terminal
     device, 0 otherwise.

     _T_t_y_s_l_o_t returns the number of the entry in the _t_t_y_s(5) file
     for the control terminal of the current process.

FILES
     /dev/*
     /etc/ttys

SEE ALSO
     ioctl(2), ttys(5)

DIAGNOSTICS
     _T_t_y_n_a_m_e returns a null pointer (0) if _f_i_l_e_d_e_s does not
     describe a terminal device in directory `/dev'.

     _T_t_y_s_l_o_t returns 0 if `/etc/ttys' is inaccessible or if it
     cannot determine the control terminal.

BUGS
     The return value points to static data whose content is
     overwritten by each call.
















Printed 12/27/86          May 15, 1985                          1