Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ wtmp(4) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

getut(3C)

login(1)

who(1)

write(1)



utmp(4)                                                   utmp(4)



NAME
     utmp, wtmp - utmp and wtmp entry formats

SYNOPSIS
     #include <sys/types.h>
     #include <utmp.h>

DESCRIPTION
     These files, which hold user and accounting information for
     such commands as who(1), write(1), and login(1), are an
     array of utmp structures with the following members:

     #define   utname   utuser

          char     utuser[8];     /* User login name */
          char     utid[4];  /* /etc/inittab id (usually line #) */
          char     utline[12];    /* device name (console, lnxx) */
          pidt    utpid;    /* process id */
          short    uttype;   /* type of entry */
          struct   exitstatus {
               short     etermination; /* Process termination status */
               short     eexit;   /* Process exit status */
          } utexit;               /* The exit status of a process
                                   marked as DEADPROCESS. */
          timet   uttime;   /* time entry was made */
          char     uthost[16];    /* host name, if remote */

     The definitions for uttype are:

     EMPTY
     RUN_LVL
     BOOT_TIME
     OLD_TIME
     NEW_TIME
     INIT_PROCESS   /* Process spawned by "init" */
     LOGIN_PROCESS  /* A "getty" process waiting for login */
     USER_PROCESS   /* A user process */
     DEAD_PROCESS
     ACCOUNTING

     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 + NULL in length

     #define   RUNLVLMSG      "run-level %c"
     #define   BOOTMSG        "system boot"
     #define   OTIMEMSG       "old time"
     #define   NTIMEMSG       "new time"

NOTES
     The structure documented above is the AT&T SYSV.2 version of
     utmp with one additional field, uthost, borrowed from



Page 1                        CX/UX Programmer's Reference Manual





utmp(4)                                                   utmp(4)



     4.2BSD.  The uthost field, as it is not compatible with
     several standards, should not be used.  The 4.2BSD version
     of utmp is a subset of the one above.

     The most significant difference between the 4.2BSD and
     SYSV.2 structures is the uttype field.  A 4.2BSD system
     distinguishes among the different types of records (login,
     logout, reboot, change of system time, etc.) in the wtmp
     file with values in utname.  A SYSV.2 system uses uttype
     for that purpose.

                 Record     4.2BSD       SYSV.2
                            utname      uttype
                 ____________________________________
                 login      login name   USER_PROCESS
                 logout     null         DEAD_PROCESS
                 reboot     '~'          BOOT_TIME
                 old date   '|'          OLD_TIME
                 new date   '}'          NEW_TIME

FILES
     /usr/include/utmp.h
     /etc/utmp
     /etc/wtmp

SEE ALSO
     getut(3C).
     login(1), who(1), write(1) in the CX/UX User's Reference
     Manual.


























Page 2                        CX/UX Programmer's Reference Manual



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