* Return the number of the slot in the utmp file
* corresponding to the current user: try for file 0, 1, 2.
* Definition is the line number in the /etc/ttys file.
static char ttys
[] = "/etc/ttys";
if ((tp
=ttyname(0))==NULL
&& (tp
=ttyname(1))==NULL
&& (tp
=ttyname(2))==NULL
)
if ((p
= rindex(tp
, '/')) == NULL
)
if ((tf
=open(ttys
, 0)) < 0)
while (tp
= getttys(tf
)) {