.TH getutline() "" "" "General Function (libc)"
.PC "Find a record in login logging file by device"
.B "#include <utmp.h>"
\fBstruct utmp *getutline(\fIline\^\fB)\fR
\fBstruct utmp *\fIline\^\fB;\fR
.PP
.II utmp
Function
.B getutline()
seeks a record for a login that occurred for a given line.
.PP
.I line
points to an object of type
.BR utmp ,
which is a structure whose fields describe a login event.
(For a detailed description of this structure, see the Lexicon entry for
.BR utmp.h .)
Before you call
.BR getutline() ,
you must initialize field \fIline\fB.ut_line\fR to the name of the device
that interests you.
.PP
If it finds a record that matches your request,
.B getutline()
copies it into a static portion of memory and returns the address of that
memory.
It returns NULL if it fails to find a record for the device you named,
or if it cannot open the login file.
.PP
By default,
.B getutline()
reads records from
.BR /etc/utmp .
If you wish to read records from another file, call
.B utmpname()
before you call
.BR getutid() .
.SH "See Also"
.Xr "libc," libc
.Xr "utmp.h" utmp.h
