Commit | Line | Data |
---|---|---|
480adfa6 TL |
1 | .TH TTYNAME 3 |
2 | .SH NAME | |
3 | ttyname, isatty, ttyslot \- find name of a terminal | |
4 | .SH SYNOPSIS | |
5 | .B char *ttyname(fildes) | |
6 | .PP | |
7 | .B isatty(fildes) | |
8 | .PP | |
9 | .B ttyslot() | |
10 | .SH DESCRIPTION | |
11 | .I Ttyname | |
12 | returns a pointer to the null-terminated path name | |
13 | of the terminal device associated with file descriptor | |
14 | .IR fildes . | |
15 | .PP | |
16 | .I Isatty | |
17 | returns 1 if | |
18 | .I fildes | |
19 | is associated with a terminal device, 0 otherwise. | |
20 | .PP | |
21 | .I Ttyslot | |
22 | returns the number of the entry in the | |
23 | .IR ttys (5) | |
24 | file for the control terminal of the | |
25 | current process. | |
26 | .SH FILES | |
27 | /dev/* | |
28 | .br | |
29 | /etc/ttys | |
30 | .SH SEE ALSO | |
31 | ioctl(2), ttys(5) | |
32 | .SH DIAGNOSTICS | |
33 | .I Ttyname | |
34 | returns a null pointer (0) if | |
35 | .I fildes | |
36 | does not describe a terminal device in directory `/dev'. | |
37 | .PP | |
38 | .I Ttyslot | |
39 | returns 0 if `/etc/ttys' is inaccessible or if | |
40 | it cannot determine the control terminal. | |
41 | .SH BUGS | |
42 | The return value points to static data | |
43 | whose content is overwritten by each call. |