m4/systemd.m4


Log

Author Commit Date CI Message
Pádraig Brady 7b089321 2025-01-01T09:24:36 maint: run 'make update-copyright'
Bruno Haible b1f65faa 2024-10-17T21:52:41 Use a warranty disclaimer in all-permissive license notices. * etc/license-notices/unlimited: Add a short warranty disclaimer sentence. * m4/*.m4: Update. * build-aux/prefix-gnulib-mk: Likewise. * HACKING: Likewise.
Bruno Haible b744688d 2024-04-04T11:16:15 Make the serial numbers in *.m4 files effective. Reported by Sam James in <https://lists.gnu.org/archive/html/bug-gnulib/2024-04/msg00051.html>. * m4/*.m4: Apply sed -e '1s|^# \(.*[.]m4\) serial |# \1\n# serial |'.
Simon Josefsson 5b92dd0a 2024-01-01T10:31:48 maint: run 'make update-copyright'
Paul Eggert f6aa86ea 2023-08-03T18:41:52 * m4/systemd.m4: Fix --help lineup.
Paul Eggert 9765d190 2023-08-03T16:01:52 readutmp: systemd supports only UTMP_FILE * lib/readutmp.c (read_utmp): Fail if not UTMP_FILE. * m4/systemd.m4 (gl_SYSTEMD_CHOICE): Default to no for now, since yes means "who /var/log/wtmp" stops working.
Bruno Haible 0b71ff37 2023-08-01T21:44:07 readutmp: For year-2038 safety on Linux/{x86,arm}, use systemd APIs. Suggested by Thorsten Kukuk <kukuk@suse.com> in <https://www.thkukuk.de/blog/Y2038_glibc_utmp_64bit/> and <https://github.com/thkukuk/utmpx/blob/main/utmp-to-logind.md>. * m4/systemd.m4: New file. * m4/readutmp.m4 (gl_READUTMP): Require gl_SYSTEMD_CHOICE. Set READUTMP_LIB. Conditionally define READUTMP_USE_SYSTEMD. * lib/readutmp.h: For READUTMP_USE_SYSTEMD, include <sys/time.h> and <utmpx.h>. (struct gl_utmp): New type. (UTMP_STRUCT_NAME, UT_TIME_MEMBER, UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT, UT_USER, HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID, HAVE_STRUCT_XTMP_UT_PID): Define differently for READUTMP_USE_SYSTEMD. (UT_USER_SIZE): Don't define for READUTMP_USE_SYSTEMD. (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, READ_UTMP_SUPPORTED): Define also for READUTMP_USE_SYSTEMD. (free_utmp): New declaration. * lib/readutmp.c: Add new includes for READUTMP_USE_SYSTEMD. (extract_trimmed_name): Adapt to READUTMP_USE_SYSTEMD. (get_boot_time_uncached, get_boot_time, guess_pty_name): New functions. (read_utmp): New implementation for READUTMP_USE_SYSTEMD. (free_utmp): New function. * tests/test-readutmp.c (main): At the end, invoke free_utmp. * modules/readutmp (Files): Add m4/systemd.m4. (Link): New section. * modules/readutmp-tests (Makefile.am): Link test-readutmp with READUTMP_LIB. * NEWS: Mention the free_utmp function and the READUTMP_LIB link requirement.