utmp

login accounting file format 

File Format


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 PTC MKS Toolkit on 10/2016/2019/11/2022/2025, although the system may create a ROOTDIR/etc/utmp file if you use the date command to set the date. Deleting this file on 10/2016/2019/11/2022/2025 does not affect the operation of PTC MKS Toolkit utilities.


AVAILABILITY

PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
who

Miscellaneous:
envvar


PTC MKS Toolkit 10.5 Documentation Build 40.