<s>
utmp	B-Application
,	O
wtmp	B-Application
,	O
btmp	O
and	O
variants	O
such	O
as	O
utmpx	B-Application
,	O
wtmpx	B-Application
and	O
btmpx	O
are	O
files	O
on	O
Unix-like	B-Operating_System
systems	I-Operating_System
that	O
keep	O
track	O
of	O
all	O
logins	O
and	O
logouts	B-General_Concept
to	O
the	O
system	O
.	O
</s>
<s>
utmp	B-Application
maintains	O
a	O
full	O
accounting	O
of	O
the	O
current	O
status	O
of	O
the	O
system	O
,	O
system	O
boot	O
time	O
(	O
used	O
by	O
uptime	O
)	O
,	O
recording	O
user	O
logins	O
at	O
which	O
terminals	O
,	O
logouts	B-General_Concept
,	O
system	O
events	O
etc	O
.	O
</s>
<s>
The	O
implementation	O
and	O
the	O
fields	O
present	O
in	O
the	O
file	O
differ	O
depending	O
on	O
the	O
system	O
or	O
the	O
libc	O
version	O
,	O
and	O
are	O
defined	O
in	O
the	O
utmp.h	O
header	O
file	O
.	O
</s>
<s>
The	O
wtmp	B-Application
and	O
btmp	O
format	O
are	O
exactly	O
like	O
utmp	B-Application
except	O
that	O
a	O
null	O
value	O
for	O
"	O
username	O
"	O
indicates	O
a	O
logout	B-General_Concept
on	O
the	O
associated	O
terminal	O
(	O
the	O
actual	O
user	O
name	O
is	O
located	O
by	O
finding	O
the	O
preceding	O
login	O
on	O
that	O
terminal	O
)	O
.	O
</s>
<s>
These	O
files	O
are	O
not	O
set	O
by	O
any	O
given	O
PAM	B-Application
module	O
(	O
such	O
as	O
pam_unix.so	O
or	O
pam_sss.so	O
)	O
but	O
are	O
set	O
by	O
the	O
application	O
performing	O
the	O
operation	O
(	O
e.g.	O
</s>
<s>
As	O
such	O
it	O
is	O
the	O
obligation	O
of	O
the	O
program	O
itself	O
to	O
record	O
the	O
utmp	B-Application
information	O
.	O
</s>
<s>
Utmpx	B-Application
and	O
wtmpx	B-Application
are	O
extensions	O
to	O
the	O
original	O
utmp	B-Application
and	O
wtmp	B-Application
,	O
originating	O
from	O
Sun	O
Microsystems	O
.	O
</s>
<s>
Utmpx	B-Application
is	O
specified	O
in	O
POSIX	O
.	O
</s>
<s>
The	O
utmp	B-Application
,	O
wtmp	B-Application
and	O
btmp	O
files	O
were	O
never	O
a	O
part	O
of	O
any	O
official	O
Unix	O
standard	O
,	O
such	O
as	O
Single	O
UNIX	O
Specification	O
,	O
while	O
utmpx	B-Application
and	O
corresponding	O
APIs	O
are	O
part	O
of	O
it	O
.	O
</s>
<s>
While	O
some	O
systems	O
create	O
different	O
newer	O
files	O
for	O
the	O
utmpx	B-Application
variants	O
and	O
have	O
deprecated/obsoleted	O
former	O
formats	O
,	O
this	O
is	O
not	O
always	O
the	O
case	O
.	O
</s>
<s>
Linux	B-Application
for	O
example	O
uses	O
the	O
utmpx	B-Application
structure	O
in	O
the	O
place	O
of	O
the	O
older	O
file	O
structure	O
.	O
</s>
<s>
Linux	B-Application
:	O
</s>
<s>
HP-UX	B-Application
:	O
</s>
<s>
FreeBSD	B-Operating_System
9.0	I-Operating_System
introduced	O
new	O
files	O
while	O
adding	O
support	O
for	O
utmpx	B-Application
:	O
</s>
<s>
This	O
includes	O
programs	O
who	B-Application
(	O
which	O
show	O
current	O
system	O
users	O
)	O
,	O
last	O
(	O
which	O
shows	O
the	O
last	O
logged	O
in	O
users	O
)	O
and	O
lastb	O
(	O
which	O
shows	O
the	O
last	O
failed	O
login	O
attempts	O
;	O
Linux-specific	O
)	O
.	O
</s>
