This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/6] y2038: Use __clock_settime64 in deprecated stime function
- From: Lukasz Majewski <lukma at denx dot de>
- To: Joseph Myers <joseph at codesourcery dot com>, Paul Eggert <eggert at cs dot ucla dot edu>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- Cc: Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at gotplt dot org>, Florian Weimer <fweimer at redhat dot com>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>, Carlos O'Donell <carlos at redhat dot com>, Andreas Schwab <schwab at suse dot de>, Lukasz Majewski <lukma at denx dot de>
- Date: Sat, 18 Jan 2020 08:20:42 +0100
- Subject: [PATCH 1/6] y2038: Use __clock_settime64 in deprecated stime function
- References: <20200118072047.23071-1-lukma@denx.de>
Now, internally the deprecated stime uses __clock_settime64. This patch is
necessary for having architectures with __WORDSIZE == 32 &&
__TIMESIZE == 32 (like e.g. ARM32) Y2038 safe.
Build tests:
./src/scripts/build-many-glibcs.py glibcs
---
time/stime.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/time/stime.c b/time/stime.c
index 576fa9c0c9..963902126b 100644
--- a/time/stime.c
+++ b/time/stime.c
@@ -27,11 +27,11 @@ int
attribute_compat_text_section
__stime (const time_t *when)
{
- struct timespec ts;
+ struct __timespec64 ts;
ts.tv_sec = *when;
ts.tv_nsec = 0;
- return __clock_settime (CLOCK_REALTIME, &ts);
+ return __clock_settime64 (CLOCK_REALTIME, &ts);
}
compat_symbol (libc, __stime, stime, GLIBC_2_0);
--
2.20.1