'\"macro stdmacro
.if n .pH g3c.ttyslot @(#)ttyslot	40.9 of 10/10/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} ttyslot 3C "C Programming Language Utilities" "\&"
.if \nX=1 .ds x} ttyslot 3C "C Programming Language Utilities"
.if \nX=2 .ds x} ttyslot 3C "" "\&"
.if \nX=3 .ds x} ttyslot "" "" "\&"
.TH \*(x}
.SH NAME
\f4ttyslot\f1 \- find the slot in the utmp file of the current user
.SH SYNOPSIS
\f4#include <stdlib.h>\f1
.sp .5
\f4int ttyslot (void);\f1
.SH DESCRIPTION
\f4ttyslot\fP
returns the index of the current user's entry in the
\f4/var/adm/utmp\f1
file.
The returned index is accomplished by scanning files
in 
\f4/dev\f1
for the name of the terminal associated with the standard
input, the standard output, or the standard error output (0, 1, or 2).
.SH FILES
\f4/var/adm/utmp\fP
.SH SEE ALSO
\f4getut\fP(3C), \f4ttyname\fP(3C).
.SH DIAGNOSTICS
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.
.\"	@(#)ttyslot.3c	6.2 of 10/20/83
.Ee
