utmp(4)
NAME
utmp, wtmp − utmp and wtmp entry formats
SYNOPSIS
#include <utmp.h>
DESCRIPTION
utmp and wtmp hold user and accounting information for commands such as who, write, and login. These files have the following structure, defined in <utmp.h>:
#defineUTMP_FILE"/var/adm/utmp"
#defineWTMP_FILE"/var/adm/wtmp"
#defineut_nameut_user
struct utmp {
char ut_user[8];/∗ user login name ∗/
char ut_id[4];/∗ /sbin/inittab id (created by ∗/
/∗ process that puts entry in utmp) ∗/
char ut_line[12];/∗ device name (console, lnxx) ∗/
short 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 as DEAD_PROCESS ∗/
time_t ut_time;/∗ time entry was made ∗/
};
/∗ Definitions for ut_type ∗/
#defineEMPTY0
#defineRUN_LVL1
#defineBOOT_TIME2
#defineOLD_TIME3
#defineNEW_TIME4
#defineINIT_PROCESS5 /∗ process spawned by "init" ∗/
#defineLOGIN_PROCESS6 /∗ a "getty" process waiting for login ∗/
#defineUSER_PROCESS7 /∗ a user process ∗/
#defineDEAD_PROCESS8
#defineACCOUNTING9
#defineUTMAXTYPEACCOUNTING /∗ max legal value of ut_type ∗/
/∗ Below are special strings or formats used in the "ut_line" ∗/
/∗ field when accounting for something other than a process. ∗/
/∗ No string for the ut_line field can be more than 11 chars + ∗/
/∗ a null character in length. ∗/
#defineRUNLVL_MSG"run−level %c"
#defineBOOT_MSG"system boot"
#defineOTIME_MSG"old time"
#defineNTIME_MSG"new time"
FILES
/var/adm/utmp
/var/adm/wtmp
SEE ALSO
SunOS 5.5.1 — Last change: 3 Jul 1990