|
|
1.1 root 1: .TH TTYNAME 3
2: .CT 2 comm_term
3: .SH NAME
4: ttyname, isatty, nametty \(mi find or set name of a terminal
5: .SH SYNOPSIS
6: .B char *ttyname(fildes)
7: .PP
8: .B isatty(fildes)
9: .PP
10: .B nametty(fildes, file)
11: .br
12: .B char *file;
13: .SH DESCRIPTION
14: .I Ttyname
15: returns a pointer to the null-terminated path name
16: of the terminal device associated with file descriptor
17: .IR fildes .
18: .PP
19: .I Isatty
20: returns 1 if
21: .I fildes
22: is associated with a terminal device,
23: 0 otherwise.
24: .PP
25: .I Nametty
26: arranges that future opens of
27: .I file
28: will refer to
29: the stream opened on
30: .IR fildes .
31: .I File
32: must exist before
33: .I nametty
34: is called.
35: The arrangement is terminated
36: when the other end of the stream
37: is closed or hung up.
38: .SH FILES
39: .F /lib/ttydevs
40: list of tty directories for
41: .I ttyname
42: .SH SEE ALSO
43: .IR fmount (2),
44: .IR ioctl (2)
45: .SH DIAGNOSTICS
46: .I Ttyname
47: returns
48: .L NULL
49: if
50: .I fildes
51: does not describe an entry in any of the directories
52: listed in
53: .FR /lib/ttydevs .
54: .PP
55: .I Nametty
56: returns 1 for success,
57: 0 for failure
58: .RI ( file
59: does not exist,
60: .I fildes
61: is not a stream).
62: .SH BUGS
63: The return value of
64: .I ttyname
65: points to static data
66: whose content is overwritten by each call.
67: .br
68: If
69: .I fildes
70: connects to a remote machine, as when serving
71: .I dcon
72: or
73: .I rx
74: (see
75: .IR con (1)),
76: .I isatty
77: answers no, regardless of whether the stream
78: leads ultimately to a terminal on the remote machine.
79: Similarly, when serving
80: .I ndcon
81: or
82: .I nrx,
83: it always answers yes.
84:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.