utmp

Updated: April 19, 2023

Entry in a user-information file

Synopsis:

#include <utmp.h>

struct utmp {
    char    ut_user[UT_NAMESIZE];
#define ut_name ut_user
    char    ut_id[4];
    char    ut_line[UT_LINESIZE];
    pid_t   ut_pid;
    short   ut_type;
    struct exit_status {
        short   e_termination;
        short   e_exit;
    } ut_exit;
    short   ut_spare;
    time_t  ut_time;
};

Description:

The utmp structure describes an entry in a user-information file. The members include:

ut_user
The user's login name.
ut_id
The line number.
ut_line
The device name (console).
ut_pid
The process ID.
ut_type
The type of entry. The possible values are:
  • EMPTY
  • RUN_LVL
  • BOOT_TIME
  • OLD_TIME
  • NEW_TIME
  • INIT_PROCESS
  • LOGIN_PROCESS
  • USER_PROCESS
  • DEAD_PROCESS
  • ACCOUNTING
ut_exit
The exit status of a process marked as DEAD_PROCESS. The structure exit_status includes at least the following members:
  • e_termination — the termination status.
  • e_exit — the exit status.
ut_time
The time that this entry was made.

Classification:

Unix