74 lines
2.2 KiB
HTML
74 lines
2.2 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>utmp(5)</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>utmp(5)</H1>
|
|
<HR>
|
|
<PRE>
|
|
|
|
</PRE>
|
|
<H2>NAME</H2><PRE>
|
|
utmp, wtmp - logged in users, login and logout history
|
|
|
|
|
|
</PRE>
|
|
<H2>SYNOPSIS</H2><PRE>
|
|
<STRONG>#include</STRONG> <STRONG><sys/types.h></STRONG>
|
|
<STRONG>#include</STRONG> <STRONG><utmp.h></STRONG>
|
|
|
|
|
|
</PRE>
|
|
<H2>DESCRIPTION</H2><PRE>
|
|
The files <STRONG>/etc/utmp</STRONG> and <STRONG>/usr/adm/wtmp</STRONG> respectively contain the currently
|
|
logged in users, and the history of logins and logouts.
|
|
|
|
Each file is an array of the following structure defined in <utmp.h>:
|
|
|
|
struct utmp {
|
|
char ut_user[8]; /* user name */
|
|
char ut_line[12]; /* terminal name */
|
|
char ut_host[16]; /* host name, when remote */
|
|
time_t ut_time; /* login/logout time */
|
|
};
|
|
|
|
#define ut_name ut_user /* for compatibility with other systems */
|
|
|
|
The structure contains more fields than those listed, but they are only
|
|
of interest to <STRONG>init</STRONG> and <STRONG>login</STRONG>. Note that the <STRONG>ut_name</STRONG> field is a
|
|
compatibility alias for <STRONG>ut_user</STRONG>, it is actually better to use it.
|
|
|
|
A login entry is completely specified. A logout entry has a null string
|
|
for <STRONG>ut_name</STRONG>. A shutdown or reboot entry has an <STRONG>ut_line</STRONG> field containing
|
|
a "~" (tilde). The <STRONG>ut_name</STRONG> field is usually the name of the program that
|
|
did the shutdown, or "reboot" at reboot. This is a bit confusing, but
|
|
note that there should always be two such entries. If you see just one
|
|
entry then the system has crashed, if you see two entries then the system
|
|
was properly shut down and later rebooted.
|
|
|
|
|
|
</PRE>
|
|
<H2>FILES</H2><PRE>
|
|
|
|
<STRONG>/etc/utmp</STRONG> Currently logged in users.
|
|
|
|
<STRONG>/usr/adm/wtmp</STRONG> History of logins and logouts.
|
|
|
|
|
|
</PRE>
|
|
<H2>SEE ALSO</H2><PRE>
|
|
<STRONG><A HREF="../man1/who.1.html">who(1)</A></STRONG>, <STRONG><A HREF="../man3/ttyslot.3.html">ttyslot(3)</A></STRONG>.
|
|
|
|
|
|
</PRE>
|
|
<H2>AUTHOR</H2><PRE>
|
|
Kees J. Bot (kjb@cs.vu.nl)
|
|
|
|
|
|
|
|
|
|
|
|
</PRE>
|
|
</BODY>
|
|
</HTML>
|