'\"!  tbl | mmdoc
'\"macro stdmacro
.if n .pH g4.utmp @(#)utmp	40.14 of 10/27/89
.\" Copyright 1989 AT&T
.nr X
.if \nX=0 .ds x} utmp 4 "" "\&"
.if \nX=1 .ds x} utmp 4 ""
.if \nX=2 .ds x} utmp 4 "" "\&"
.if \nX=3 .ds x} utmp "" "" "\&"
.TH \*(x}
.SH NAME
\f4utmp\f1, \f4wtmp\f1 \- utmp and wtmp entry formats
.SH SYNOPSIS
\f4#include <utmp.h>\f1
.SH DESCRIPTION
These files, which hold user and accounting information
for such commands as
\f4who\f1,
\f4write\f1,
and
\f4login\f1,
have the following structure, defined in
\f4<utmp.h>\f1:
.PP
.TS
l lp-1 l.
\f4#define	UTMP_FILE	"/var/adm/utmp"
#define	WTMP_FILE	"/var/adm/wtmp"
.T&
l l l.
#define	ut_name	ut_user\f1
.TE
.PP
.TS
l1 l1 l1 l.
.tr ~ 
\f4struct     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 \(**/
};\f1
.tr ~~
.TE
.PP
\f4/\(**  Definitions for ut_type  \(**/
.TS
l1f4 l1f4 l1f4 lf4.
#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 \(**/
#define DEAD_PROCESS  8
#define ACCOUNTING    9
#define UTMAXTYPE     ACCOUNTING /\(** max legal value of ut_type \(**/\f1
.TE
.nf
\f4/\(**  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.  \(**/\f1
.TS
l1 l1p-1 l.
\f4#define	RUNLVL_MSG	"run\-level %c"
#define	BOOT_MSG	"system boot"
#define	OTIME_MSG	"old time"
#define	NTIME_MSG	"new time"\f1
.TE
.fi
.SH FILES
\f4/var/adm/utmp\f1
.br
\f4/var/adm/wtmp\f1
.SH SEE ALSO
\f4getut\f1(3C).
.br
\f4login\f1(1), \f4who\f1(1), \f4write\f1(1) in the
\f2User's Reference Manual\f1.
\"	@(#)utmp.4	6.2 of 10/20/83
.Ee
