BSD 4_4 development
[unix-history] / usr / share / man / cat3 / ttyname.0
CommitLineData
8bb980a3
C
1TTYNAME(3) BSD Programmer's Manual TTYNAME(3)
2
3N\bNA\bAM\bME\bE
4 t\btt\bty\byn\bna\bam\bme\be, i\bis\bsa\bat\btt\bty\by, t\btt\bty\bys\bsl\blo\bot\bt - get name of associated terminal (tty) from
5 file descriptor
6
7S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
8 #\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<u\bun\bni\bis\bst\btd\bd.\b.h\bh>\b>
9
10 _\bc_\bh_\ba_\br _\b*
11 t\btt\bty\byn\bna\bam\bme\be(_\bi_\bn_\bt _\bf_\bd);
12
13 _\bi_\bn_\bt
14 i\bis\bsa\bat\btt\bty\by(_\bi_\bn_\bt _\bf_\bd);
15
16 _\bi_\bn_\bt
17 t\btt\bty\bys\bsl\blo\bot\bt();
18
19D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
20 These functions operate on the system file descriptors for terminal type
21 devices. These descriptors are not related to the standard I/O FILE type-
22 def, but refer to the special device files found in _\b/_\bd_\be_\bv and named
23 _\b/_\bd_\be_\bv_\b/_\bt_\bt_\by_\bx_\bx and for which an entry exists in the initialization file
24 _\b/_\be_\bt_\bc_\b/_\bt_\bt_\by_\bs_\b. (See ttys(5).)
25
26 The i\bis\bsa\bat\btt\bty\by() function determines if the file descriptor _\bf_\bd refers to a
27 valid terminal type device.
28
29 The t\btt\bty\byn\bna\bam\bme\be() function gets the related device name of a file descriptor
30 for which i\bis\bsa\bat\btt\bty\by() is true
31
32 The t\btt\bty\bys\bsl\blo\bot\bt() function fetches the current process' control terminal num-
33 ber from the ttys(5) file entry.
34
35R\bRE\bET\bTU\bUR\bRN\bN V\bVA\bAL\bLU\bUE\bES\bS
36 The t\btt\bty\byn\bna\bam\bme\be() function returns the null terminated name if the device is
37 found and i\bis\bsa\bat\btt\bty\by() is true; otherwise a NULL pointer is returned.
38
39 The t\btt\bty\bys\bsl\blo\bot\bt() function returns the unit number of the device file if
40 found; otherwise the value zero is returned.
41
42F\bFI\bIL\bLE\bES\bS
43 /dev/*
44 /etc/ttys
45
46S\bSE\bEE\bE A\bAL\bLS\bSO\bO
47 ioctl(2), ttys(5)
48
49H\bHI\bIS\bST\bTO\bOR\bRY\bY
50 A i\bis\bsa\bat\btt\bty\by(), t\btt\bty\byn\bna\bam\bme\be(), and t\btt\bty\bys\bsl\blo\bot\bt() function appeared in Version 7 AT&T
51 UNIX.
52
53B\bBU\bUG\bGS\bS
54 The t\btt\bty\byn\bna\bam\bme\be() function leaves its result in an internal static object and
55 returns a pointer to that object. Subsequent calls to t\btt\bty\byn\bna\bam\bme\be() will mod-
56 ify the same object.
57
584.4BSD June 4, 1993 1