[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    ttyslot(3C) manual page Table of Contents

Name

ttyslot - find the slot in the utmp file of the current user

Synopsis

#include <stdlib.h>

int ttyslot(void);

MT-Level

Safe

Description

ttyslot() returns the index of the current user’s entry in the /var/adm/utmp file. The returned index is accomplished by scanning files in /dev for the name of the terminal associated with the standard input, the standard output, or the standard error output (0, 1, or 2).

Return Values

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.

Files

/var/adm/utmp

See Also

getutent(3C) , ttyname(3C)


Table of Contents