Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

w(1)

login(1)

who(1)

last(1)

utmp(4)

write(1)

xdm(1)

getut(3C)

getutx(3C)



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 ut_host 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
     ut_user and ut_line fields accommodate longer strings than their utmp
     counterparts.

     utmpx and wtmpx records have the following structure, defined in utmpx.h:

     #define UTMPX_FILE   "/var/adm/utmpx"
     #define WTMPX_FILE   "/var/adm/wtmpx"
     #define ut_name      ut_user
     #define ut_xtime     ut_tv.tv_sec

struct utmpx {
char ut_user[32]; /* user login name */
char ut_id[4]; /* /etc/inittab id (created by */
/* process that puts entry in utmp) */
char ut_line[32]; /* device name (console, lnxx) */
pid_t ut_pid; /* process id */
short ut_type; /* type of entry */
struct exit_status {
short e_termination; /* process termination status */
short e_exit; /* process exit status */
} ut_exit; /* exit status of a process */
/* marked DEAD_PROCESS */
struct timeval ut_tv; /* time entry was made */
long ut_session; /* session ID, used for windowing */
long pad[5]; /* reserved for future use */
short ut_syslen; /* length of ut_host including null */
char ut_host[257]; /* remote host name */
};
/* Definitions for ut_type */
#define EMPTY 0
#define RUN_LVL 1
#define BOOT_TIME 2
#define OLD_TIME 3
#define NEW_TIME 4
#define INIT_PROCESS 5 /* process spawned by "init" */
#define LOGIN_PROCESS 6 /* a "getty" process waiting for login */
#define USER_PROCESS 7 /* a user process */
Page 1


utmpx(4)                                                              utmpx(4)



     #define DEAD_PROCESS  8
     #define ACCOUNTING    9
     #define UTMAXTYPE     ACCOUNTING /* max legal value of ut_type */

/* Below are the special strings or formats used in the "ut_line" */
/* field when accounting for something other than a process. */
/* Strings for the ut_line field must be no more than 31 chars + */
/* terminating NULL in length. */
#define RUNLVL_MSG "run-level %c" #define BOOT_MSG "system boot" #define OTIME_MSG "old time" #define NTIME_MSG "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 ut_host field accommodates 257-character strings (256 chars + NULL), many commands truncate it for simpler formatting. "w -W" displays the ut_host 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

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026