Manual Pages for UNIX Darwin command on man ttyname
MyWebUniversity

Manual Pages for UNIX Darwin command on man ttyname

TTYNAME(3) BSD Library Functions Manual TTYNAME(3)

NAME

ttttyynnaammee, iissaattttyy, ttttyysslloott - get name of associated terminal (tty) from

file descriptor LLIIBBRRAARRYY

Standard C Library (libc, -lc)

SYNOPSIS

##iinncclluuddee <>

char * ttttyynnaammee(int fd); int iissaattttyy(int fd); int ttttyysslloott(void);

DESCRIPTION

These functions operate on the system file descriptors for terminal type devices. These descriptors are not related to the standard I/O FILE typedef, but refer to the special device files found in /dev and named /dev/ttyxx and for which an entry exists in the initialization file /etc/ttys. (See ttys(5).) The iissaattttyy() function determines if the file descriptor fd refers to a valid terminal type device. The ttttyynnaammee() function gets the related device name of a file descriptor for which iissaattttyy() is true

The ttttyysslloott() function fetches the current process' control terminal num-

ber from the ttys(5) file entry.

RETURN VALUES

The ttttyynnaammee() function returns the null terminated name if the device is found and iissaattttyy() is true; otherwise a NULL pointer is returned. The ttttyysslloott() function returns the unit number of the device file if found; otherwise the value zero is returned. FILES /dev/* /etc/ttys

SEE ALSO

ioctl(2), ttys(5) HISTORY A iissaattttyy(), ttttyynnaammee(), and ttttyysslloott() function appeared in Version 7 AT&T UNIX.

BUGS

The ttttyynnaammee() function leaves its result in an internal static object and returns a pointer to that object. Subsequent calls to ttttyynnaammee() will modify the same object. BSD June 4, 1993 BSD




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™