utmp(4) utmp(4)
NAME
utmp, wtmp - entry formats
SYNOPSIS
#include <utmp.h>
#include <wtmp.h>
DESCRIPTION
These files, which hold user and accounting information for such com-
mands as who, write, and login, have the following structure, defined
in utmp.h:
#define UTMPFILE "/var/adm/utmp"
#define WTMPFILE "/var/adm/wtmp"
#define utname utuser
struct utmp {
char utuser[8]; /* user login name */
char utid[4]; /* /sbin/inittab id (created by */
/* process that puts entries in utmp) */
char utline[12]; /* device name (console, lnxx) */
short utpid; /* process id */
short uttype; /* type of entry */
struct exitstatus {
short etermination; /* process termination status */
short eexit; /* error exit status */
} utexit; /* exit status of a process
marked as DEADPROCESS */
timet uttime; /* time entry was made */
};
/* 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 */
#define DEADPROCESS 8
#define ACCOUNTING 9
#define UTMAXTYPE ACCOUNTING /* max legal value of uttype */
/* Below are special strings or formats used in the "utline" */
/* field when accounting for something other than a process. */
/* No string for the utline field can be more than 11 chars + */
/* a null character in length. */
Page 1 Reliant UNIX 5.44 Printed 11/98
utmp(4) utmp(4)
#define!RUNLVLMSG!"run level %c"
#define!BOOTMSG !"system boot"
#define!OTIMEMSG !"old time"
#define!NTIMEMSG !"new time"
The following functions are declared:
void endutent(void)
struct utmp *getutent(void)
struct utmp *getuid(const struct utmp*);
struct utmp *getutline(const struct utmp*);
struct utmp *pututline(const struct utmp*);
void setutent(void);
int utmpname(const char *);
FILES
/var/adm/utmp
/var/adm/wtmp
SEE ALSO
login(1), who(1), write(1), getut(3C).
Page 2 Reliant UNIX 5.44 Printed 11/98