.TH utmpname() "" "" "General Function (libc)"
.PC "Manipulate a login logging file other than /etc/utmp"
.B "#include <utmp.h>"
\fBint utmpname(\fIfile\^\fB)\fR
\fBconst char *\fIfile\^\fB;\fR
.PP
The system files
.B /etc/utmp
and
.B /usr/adm/wtmp
record information about every login event on your system \(em that is,
they record every time someone logs into your system, the line from which
the user logged in, and how long he was logged in.
\*(CO comes with a set of functions that manipulate these files:
they let you open a logging file, reads records, and update them.
.PP
By default, these functions manipulate the file
.BR /etc/utmp ,
which records the login events that are active \(em that is,
the user has logged in but not yet logged out.
Function
.B utmpname()
lets you change the file being manipulated.
.I file
points to the name of the file you wish to manipulate.
Usually, this is the file
.BR /usr/adm/wtmp ,
which records login events that have concluded; but you can name any file
in which you or the system has recorded login events.
.B utmpname()
also closes the logging file that is already open.
.SH "See Also"
.Xr "libc," libc
.Xr "utmp.h" utmp.h
