1TTYNAME(3) 386BSD Programmer's Manual TTYNAME(3) 2 3NNAAMMEE 4 ttttyynnaammee, iissaattttyy, ttttyysslloott - get name of associated terminal (tty) from 5 file descriptor 6 7SSYYNNOOPPSSIISS 8 ##iinncclluuddee <<uunniissttdd..hh>> 9 10 _c_h_a_r * 11 ttttyynnaammee(_i_n_t _f_d) 12 13 _i_n_t 14 iissaattttyy(_i_n_t _f_d) 15 16 _i_n_t 17 ttttyysslloott() 18 19DDEESSCCRRIIPPTTIIOONN 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 22 typedef, but refer to the special device files found in /_d_e_v and named 23 /_d_e_v/_t_t_y_x_x and for which an entry exists in the initialization file 24 /_e_t_c/_t_t_y_s. (See ttys(5).) 25 26 The iissaattttyy() function determines if the file descriptor _f_d refers to a 27 valid terminal type device. 28 29 The ttttyynnaammee() function gets the related device name of a file descriptor 30 for which iissaattttyy() is true 31 32 The ttttyysslloott() function fetches the current process' control terminal 33 number from the ttys(5) file entry. 34 35RREETTUURRNN VVAALLUUEESS 36 The ttttyynnaammee() function returns the null terminated name if the device is 37 found and iissaattttyy() is true; otherwise a NULL pointer is returned. 38 39 The ttttyysslloott() function returns the unit number of the device file if 40 found; otherwise the value zero is returned. 41 42FFIILLEESS 43 /dev/* 44 /etc/ttys 45 46SSEEEE AALLSSOO 47 ioctl(2), ttys(5) 48 49HHIISSTTOORRYY 50 A iissaattttyy(), ttttyynnaammee(), and ttttyysslloott() function appeared in Version 7 AT&T 51 UNIX. 52 53BBUUGGSS 54 The ttttyynnaammee() function leaves its result in an internal static object and 55 returns a pointer to that object. Subsequent calls to ttttyynnaammee() will 56 modify the same object. 57 58BSD Experimental April 19, 1991 1 59 60 61 62 63 64 65 66 67