Manual Page Result
0
Command: ttyname | Section: 3 | Source: UNIX v10 | File: ttyname.3
TTYNAME(3) Library Functions Manual TTYNAME(3)
NAME
ttyname, isatty, nametty - find or set name of a terminal
SYNOPSIS
char *ttyname(fildes)
isatty(fildes)
nametty(fildes, file)
char *file;
DESCRIPTION
Ttyname returns a pointer to the null-terminated path name of the ter-
minal device associated with file descriptor fildes.
Isatty returns 1 if fildes is associated with a terminal device, 0 oth-
erwise.
Nametty arranges that future opens of file will refer to the stream
opened on fildes. File must exist before nametty is called. The
arrangement is terminated when the other end of the stream is closed or
hung up.
FILES
list of tty directories for ttyname
SEE ALSO
fmount(2), ioctl(2)
DIAGNOSTICS
Ttyname returns if fildes does not describe an entry in any of the di-
rectories listed in
Nametty returns 1 for success, 0 for failure (file does not exist,
fildes is not a stream).
BUGS
The return value of ttyname points to static data whose content is
overwritten by each call.
If fildes is a network connection, isatty may produce answers having
more to do with the network than to the file to which network data is
copied. In particular, it always returns no for connections set up by
rx, and always returns yes for connections arranged by dcon; see
con(1).
TTYNAME(3)