4 * getutline.c: not-quite-compatible replacement for getutline(3)
5 * by nathan bryant, feb 1999
12 #include <sys/types.h>
19 struct utmp
*getutline(struct utmp
*ut
)
21 static struct utmp retval
;
25 if ((utmp
= fopen(UTMP_FILE
, "rb")) == NULL
)
27 if ((utmp
= fopen(_PATH_UTMP
, "rb")) == NULL
)
32 if (!fread(&retval
, sizeof retval
, 1, utmp
))
37 while (strcmp(ut
->ut_line
, retval
.ut_line
));
42 #endif /* HAVE_UTMP_H */