* util/utmp.c: Set of functions for dealing with utmp and wtmp (utmp_read_runlevel): Read the current runlevel from the file (utmp_get_runlevel): Obtain the current runlevel from the environment, or the file if not set (utmp_write_runlevel): Write a runlevel change record, and also deal with the reboot record if the utmp or wtmp files don't quite match. (utmp_write_shutdown): Write a shutdown time record (utmp_entry, utmp_write, wtmp_write): utility functions for creating and writing utmp and wtmp records. * util/utmp.h: Prototypes for new functions. * util/tests/test_utmp.c: Test cases. * util/Makefile.am (test_utmp_SOURCES, test_utmp_LDFLAGS) (test_utmp_LDADD): Details for utmp test cases (tests): Move to the bottom of the file and make PHONY