NAME
ttyslot — find the
slot of the current user in the user accounting database (LEGACY)
SYNOPSIS
#include <stdlib.h> int ttyslot(void);
DESCRIPTION
The ttyslot() function returns the index of the current user's entry in the user accounting database. The current user's entry is an entry for which the utline member matches the name of a terminal device associated with any of the process' file descriptors 0, 1 or 2. The index is an ordinal number representing the record number in the database of the current user's entry. The first entry in the database is represented by the return value 0.
This interface need not be reentrant.
RETURN VALUE
Upon successful completion, ttyslot() returns the index of the current user's entry in the user accounting database. The ttyslot() function returns -1 if an error was encountered while searching the database or if none of file descriptors 0, 1 or 2 is associated with a terminal device.
ERRORS
No errors are defined.
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
endutxent(3) , ttyname(3) , <stdlib.h> .