about summary refs log tree commit diff
path: root/login
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2024-04-19 14:38:17 +0200
committerFlorian Weimer <fweimer@redhat.com>2024-05-02 19:30:48 +0200
commit85242ed63a33cac458eae3ffe504693680b686d9 (patch)
tree2ac8260b98175787a44289e0d3763c0ff218a0e0 /login
parenteeeaf0fe2df339889f30f166c0b3c488535700cb (diff)
downloadglibc-85242ed63a33cac458eae3ffe504693680b686d9.tar.gz
glibc-85242ed63a33cac458eae3ffe504693680b686d9.tar.xz
glibc-85242ed63a33cac458eae3ffe504693680b686d9.zip
login: structs utmp, utmpx, lastlog _TIME_BITS independence (bug 30701)
These structs describe file formats under /var/log, and should not
depend on the definition of _TIME_BITS.  This is achieved by
defining __WORDSIZE_TIME64_COMPAT32 to 1 on 32-bit ports that
support 32-bit time_t values (where __time_t is 32 bits).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
(cherry picked from commit 9abdae94c7454c45e02e97e4ed1eb1b1915d13d8)
Diffstat (limited to 'login')
-rw-r--r--login/Makefile4
-rw-r--r--login/tst-utmp-size-64.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/login/Makefile b/login/Makefile
index ffe9f38114..0b6b962c06 100644
--- a/login/Makefile
+++ b/login/Makefile
@@ -44,7 +44,9 @@ subdir-dirs = programs
 vpath %.c programs
 
 tests := tst-utmp tst-utmpx tst-grantpt tst-ptsname tst-getlogin tst-updwtmpx \
-  tst-pututxline-lockfail tst-pututxline-cache tst-utmp-size
+  tst-pututxline-lockfail tst-pututxline-cache tst-utmp-size tst-utmp-size-64
+
+CFLAGS-tst-utmp-size-64.c += -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64
 
 # Empty compatibility library for old binaries.
 extra-libs      := libutil
diff --git a/login/tst-utmp-size-64.c b/login/tst-utmp-size-64.c
new file mode 100644
index 0000000000..7a581a4c12
--- /dev/null
+++ b/login/tst-utmp-size-64.c
@@ -0,0 +1,2 @@
+/* The on-disk layout must not change in time64 mode.  */
+#include "tst-utmp-size.c"