BSD 4_2 development
[unix-history] / usr / man / man3 / ttyname.3
CommitLineData
5b79f985
C
1.TH TTYNAME 3 "19 January 1983"
2.SH NAME
3ttyname, isatty, ttyslot \- find name of a terminal
4.SH SYNOPSIS
5.B char *ttyname(filedes)
6.PP
7.B isatty(filedes)
8.PP
9.B ttyslot()
10.SH DESCRIPTION
11.I Ttyname
12returns a pointer to the null-terminated path name
13of the terminal device associated with file descriptor
14.I filedes
15(this is a system file descriptor and has nothing to do with the
16standard I/O FILE typedef).
17.PP
18.I Isatty
19returns 1 if
20.I filedes
21is associated with a terminal device, 0 otherwise.
22.PP
23.I Ttyslot
24returns the number of the entry in the
25.IR ttys (5)
26file for the control terminal of the current process.
27.SH FILES
28/dev/\(**
29.br
30/etc/ttys
31.SH SEE ALSO
32ioctl(2), ttys(5)
33.SH DIAGNOSTICS
34.I Ttyname
35returns a null pointer (0) if
36.I filedes
37does not describe a terminal device in directory `/dev'.
38.PP
39.I Ttyslot
40returns 0 if `/etc/ttys' is inaccessible or if
41it cannot determine the control terminal.
42.SH BUGS
43The return value points to static data
44whose content is overwritten by each call.