DESCRIPTION
Login accounting information is stored in two files. ROOTDIR/etc/utmp holds the current state of each item being accounted, for while ROOTDIR/etc/wtmp maintains the history of changes to each accounting item. Both files are just arrays of the following binary records described in the form of a C data structure:
#include <sys/types.h>
struct utmp {
char ut_user[8]; /* Login user name */
char ut_id[4]; /* ID from ROOTDIR/etc/inittab */
char ut_line[12]; /* Login terminal name */
ulong ut_pid; /* Process id */
short ut_type; /* Entry type (see below) */
struct exit_status {
/* Process termination+exit status*/
short e_termination;
short e_exit;
} ut_exit; /* Used with DEAD_PROCESS */
time_t ut_time; /* Entry created */
};
#define EMPTY 0 /* Unused */
#define RUN_LVL 1 /* Set new run level */
#define BOOT_TIME 2 /* System boot */
#define OLD_TIME 3 /* Time of date change - delta */
#define NEW_TIME 4 /* Time of date change + delta */
#define INIT_PROCESS 5 /* Process started by ROOTDIR/etc/init */
#define LOGIN_PROCESS 6 /* Login process */
#define USER_PROCESS 7 /* User process */
#define DEAD_PROCESS 8 /* Contains exit status */
#define ACCOUNTING 9 /* Other accounting */
FILES
- ROOTDIR/etc/utmp
-
reflects the current state of the accounting entries, for example, who is logged in, when the date was last set, and so on.
- ROOTDIR/etc/wtmp
-
contains a history of changes to any of the accounting entries.
PORTABILITY
Both ROOTDIR/etc/utmp and ROOTDIR/etc/wtmp are located using the ROOTDIR variable (if it has been set).
utmp is not provided as part of MKS Toolkit on Windows NT/2000/XP/2003/Vista/7/2008, although the system may create a ROOTDIR/etc/utmp file if you use the date command to set the date. Deleting this file on Windows NT/2000/XP/2003/Vista/7/2008 does not affect the operation of MKS Toolkit utilities.
AVAILABILITY
MKS Toolkit for Power Users
MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Commands:
- who
- Miscellaneous:
- envvar
MKS Toolkit 9.3 Documentation Build 6.