ttyslot(3C) ttyslot(3C)
ttyslot - find the slot in the utmp file of the current user
#include <stdlib.h>
int ttyslot (void);
ttyslot returns the index of the current user's entry in the
/var/adm/utmp file. This is accomplished by calling ttyname(3C) to
determine which device the calling program has associated with the
standard input, the standard output, or the error output (0, 1 or 2).
This device name is then searched for in the /var/adm/utmp file.
/var/adm/utmp
getut(3C), ttyname(3C)
A value of -1 is returned if an error was encountered while searching for
the terminal name or if none of the above file descriptors are associated
with a terminal device.
PPPPaaaaggggeeee 1111 [ Back ]
|