utmpx(4) utmpx(4)
NAME
utmpx, wtmpx - utmp and wtmp extended-format entries
SYNOPSIS
#include <utmpx.h>
DESCRIPTION
utmpx and wtmpx files are extended versions of utmp and wtmp, resp.,
containing records of type struct utmpx. The utmpx struct is a superset
of the utmp struct, containing both additional fields and larger array
allocation for several existing fields. utmpx's most significant
addition is the uthost field, which identifies the host from which the
entry's job originated (if applicable). All Silicon Graphics X terminal
emulators initialize the field to $DISPLAY (see xdm(1)), but it may be
blank (eg. a dumb terminal connected to a serial port). Also, utmpx's
utuser and utline fields accommodate longer strings than their utmp
counterparts.
utmpx and wtmpx records have the following structure, defined in utmpx.h:
#define UTMPXFILE "/var/adm/utmpx"
#define WTMPXFILE "/var/adm/wtmpx"
#define utname utuser
#define utxtime uttv.tvsec
struct utmpx {
char utuser[32]; /* user login name */
char utid[4]; /* /etc/inittab id (created by */
/* process that puts entry in utmp) */
char utline[32]; /* device name (console, lnxx) */
pidt utpid; /* process id */
short uttype; /* type of entry */
struct exitstatus {
short etermination; /* process termination status */
short eexit; /* process exit status */
} utexit; /* exit status of a process */
/* marked DEADPROCESS */
struct timeval uttv; /* time entry was made */
long utsession; /* session ID, used for windowing */
long pad[5]; /* reserved for future use */
short utsyslen; /* length of uthost including null */
char uthost[257]; /* remote host name */
};
/* Definitions for uttype */
#define EMPTY 0
#define RUNLVL 1
#define BOOTTIME 2
#define OLDTIME 3
#define NEWTIME 4
#define INITPROCESS 5 /* process spawned by "init" */
#define LOGINPROCESS 6 /* a "getty" process waiting for login */
#define USERPROCESS 7 /* a user process */
Page 1
utmpx(4) utmpx(4)
#define DEADPROCESS 8
#define ACCOUNTING 9
#define UTMAXTYPE ACCOUNTING /* max legal value of uttype */
/* Below are the special strings or formats used in the "utline" */
/* field when accounting for something other than a process. */
/* Strings for the utline field must be no more than 31 chars + */
/* terminating NULL in length. */
#define RUNLVLMSG "run-level %c"
#define BOOTMSG "system boot"
#define OTIMEMSG "old time"
#define NTIMEMSG "new time"
FILES
/var/adm/utmpx
/var/adm/wtmpx
WARNING
All changes to /var/adm/wtmp must also be logged in /var/adm/wtmpx. Most
commands that extract information from these files silently discard all
wtmpx entries without wtmp complements.
CAVEATS
Although the uthost field accommodates 257-character strings (256 chars
+ NULL), many commands truncate it for simpler formatting. "w -W"
displays the uthost field on a new line, and in its entirety.
SEE ALSO
w(1), login(1), who(1), last(1), utmp(4), write(1), xdm(1), getut(3C),
getutx(3C)
Page 2