Commit | Line | Data |
---|---|---|
03a95d0f | 1 | .\" @(#)ttyname.3 6.1 (Berkeley) %G% |
2264871c | 2 | .\" |
03a95d0f | 3 | .TH TTYNAME 3 "" |
2264871c KM |
4 | .AT 3 |
5 | .SH NAME | |
6 | ttyname, isatty, ttyslot \- find name of a terminal | |
7 | .SH SYNOPSIS | |
9959ea4e | 8 | .B char *ttyname(filedes) |
2264871c | 9 | .PP |
9959ea4e | 10 | .B isatty(filedes) |
2264871c KM |
11 | .PP |
12 | .B ttyslot() | |
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 | |
9959ea4e KM |
17 | .I filedes |
18 | (this is a system file descriptor and has nothing to do with the | |
19 | standard I/O FILE typedef). | |
2264871c KM |
20 | .PP |
21 | .I Isatty | |
22 | returns 1 if | |
9959ea4e | 23 | .I filedes |
2264871c KM |
24 | is associated with a terminal device, 0 otherwise. |
25 | .PP | |
26 | .I Ttyslot | |
27 | returns the number of the entry in the | |
28 | .IR ttys (5) | |
9959ea4e | 29 | file for the control terminal of the current process. |
2264871c KM |
30 | .SH FILES |
31 | /dev/\(** | |
32 | .br | |
33 | /etc/ttys | |
34 | .SH SEE ALSO | |
35 | ioctl(2), ttys(5) | |
36 | .SH DIAGNOSTICS | |
37 | .I Ttyname | |
38 | returns a null pointer (0) if | |
9959ea4e | 39 | .I filedes |
2264871c KM |
40 | does not describe a terminal device in directory `/dev'. |
41 | .PP | |
42 | .I Ttyslot | |
43 | returns 0 if `/etc/ttys' is inaccessible or if | |
44 | it cannot determine the control terminal. | |
45 | .SH BUGS | |
46 | The return value points to static data | |
47 | whose content is overwritten by each call. |