ttyslot
Purpose
Finds the slot in the utmp file for the current user.
Library
Standard C Library (libc.a)
Syntax
int ttyslot ( )
Description
The ttyslot subroutine returns the index of the current
user's entry in the /etc/utmp file. The ttyslot subrou-
tine scans the /etc/utmp file for the name of the ter-
minal associated with the standard input, the standard
output, or the error output (0, 1, or 2).
The ttyslot subroutine returns 0 if an error was encount-
ered while searching for the terminal name, or if none of
the first three file descriptors (0, 1, and 2) is associ-
ated with a terminal device.
Files
/etc/inittab
/etc/utmp
Related Information
In this book: "getutent" and "ttyname, isatty."