int ttyslot()
ttyslot() returns the index of the current user's entry in /etc/utmp. This is accomplished by actually scanning the file /etc/ttytab for the name of the terminal associated with the standard input, the standard output, or the error output (0, 1 or 2).
On success, ttyslot() returns the index of the current user's entry in /etc/utmp. If an error was encountered while searching for the terminal name or if none of the above file descriptors is associated with a terminal device, ttyslot() returns 0.
If an error was encountered while searching for the terminal name or if none of the above file descriptors is associated with a terminal device, ttyslot() returns -1.
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97