|
|
researchv10 Dan Cross
.TH TTYNAME 3 .CT 2 comm_term .SH NAME ttyname, isatty, nametty \(mi find or set name of a terminal .SH SYNOPSIS .B char *ttyname(fildes) .PP .B isatty(fildes) .PP .B nametty(fildes, file) .br .B char *file; .SH DESCRIPTION .I Ttyname returns a pointer to the null-terminated path name of the terminal device associated with file descriptor .IR fildes . .PP .I Isatty returns 1 if .I fildes is associated with a terminal device, 0 otherwise. .PP .I Nametty arranges that future opens of .I file will refer to the stream opened on .IR fildes . .I File must exist before .I nametty is called. The arrangement is terminated when the other end of the stream is closed or hung up. .SH FILES .F /lib/ttydevs list of tty directories for .I ttyname .SH SEE ALSO .IR fmount (2), .IR ioctl (2) .SH DIAGNOSTICS .I Ttyname returns .L NULL if .I fildes does not describe an entry in any of the directories listed in .FR /lib/ttydevs . .PP .I Nametty returns 1 for success, 0 for failure .RI ( file does not exist, .I fildes is not a stream). .SH BUGS The return value of .I ttyname points to static data whose content is overwritten by each call. .br If .I fildes is a network connection, .I 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 .IR rx , and always returns yes for connections arranged by .IR dcon ; see .IR con (1).
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.