#define UT_NAMESIZE 8 #define UT_LINESIZE 8 #define UT_HOSTSIZE 16
struct lastlog { time_t ll_time;
char ll_line[UT_LINESIZE];
char ll_host[UT_HOSTSIZE];
};
struct utmp { char ut_line[UT_LINESIZE];
char ut_name[UT_NAMESIZE];
char ut_host[UT_HOSTSIZE];
time_t ut_time;
}; Each time a user logs in, the program looks up the user’s in the
file If it is found, the timestamp of the last time the user logged in,
the terminal line and the hostname are written to the standard output. (Providing
the login is not see The program then records the new login time in
the file After the new record is written , the file is opened and
the record for the user inserted. This record remains there until the user
logs out at which time it is deleted. The file is used by the programs
and Next, the program opens the file and appends the user’s record.
The same record, with an updated time stamp is later appended to the file
when the user logs out. (See The file is used by the programs and In
the event of a date change, a shutdown or reboot, the following items are
logged in the file. A system reboot or shutdown has been initiated.
The character is placed in the field and or in the field (See and
The system time has been manually or automatically updated. (See The
command name is recorded in the field In the field the character indicates
the time prior to the change, and the character indicates the new time.