utmpx(4) utmpx(4)
NAME
utmpx, wtmpx - entry formats
SYNOPSIS
#include <utmpx.h>
#include <wtmpx.h>
DESCRIPTION
utmpx is an extended version of utmp(4).
These files, which hold user and accounting information for such com-
mands as who, write, and login, have the following structure as
defined by <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]; /* inittab id */
char utline[32]; /* device name (console, lnxx) */
pidt utpid; /* process id */
short uttype; /* type of entry */
struct exitstatus utexit; /* process termination/exit status */
struct timeval uttv; /* time entry was made */
long utsession; /* session ID, used for windowing */
long pad[5]; /* reserved */
short utsyslen; /* significant length of uthost */
/* including terminating null */
char uthost[257]; /* remote host name */
} ;
/* Definitions for uttype */
#define EMPTY 0 /* No valid user accounting information */
#define RUNLVL 1
#define BOOTTIME 2 /* Time of system boot */
#define OLDTIME 3 /* Time when system clock changed */
#define NEWTIME 4 /* Time after system clock changed */
#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 /* A session leader who has exited */
#define ACCOUNTING 9
#define UTMAXTYPE ACCOUNTING /* Largest legal value of uttype */
Page 1 Reliant UNIX 5.44 Printed 11/98
utmpx(4) utmpx(4)
/* 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. */
#define RUNLVLMSG "run-level %c"
#define BOOTMSG "system boot"
#define OTIMEMSG "old time"
#define NTIMEMSG "new time"
#define MODWIN 10
The following functions are declared:
void endutxent(void);
struct utmpx *getutxent(void);
struct utmpx *getutxid(const struct utmpx*);
struct utmpx *getutxline(const struct utmpx*);
struct utmpx *pututxline(const struct utmpx*);
void setutxent(void);
int utmpxname(const char*);
struct utmpx *makeutx(const struct utmpx*);
struct utmpx *modutx(const struct utmpx*);
void getutmp(const struct utmpx*, struct utmp*);
void getutmpx(const struct utmp*, struct utmpx*);
void updwtmp(const char*, struct utmp*);
void updwtmpx(const char*, struct utmpx*);
NOTES
The timeval structure is defined as described in <sys/time.h>. Inclu-
sion of the <utmpx.h> header may also make visible all symbols from
<sys/time.h>.
The pidt type is defined through typedef as described in
<sys/types.h>.
FILES
/var/adm/utmpx
/var/adm/wtmpx
SEE ALSO
login(1), who(1), write(1), getutx(3C), time(5), types(5).
Page 2 Reliant UNIX 5.44 Printed 11/98