From ee6f1ddadebd8a0edc42d33dbc7d55d2c61962d9 Mon Sep 17 00:00:00 2001 From: ellie timoney Date: Fri, 12 Apr 2024 10:49:13 +1000 Subject: [PATCH] cunit/timeofday.c: intercept the 64-bit gettimeofday() This already worked correctly on 64-bit platforms, and on 32-bit platforms with 32-bit time, but was broken on 32-bit platforms with 64-bit time. --- cunit/timeofday.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cunit/timeofday.c b/cunit/timeofday.c index 50e121bf1f2..59797b07a53 100644 --- a/cunit/timeofday.c +++ b/cunit/timeofday.c @@ -198,8 +198,13 @@ void time_restore(void) /* call the real libc function */ static int real_gettimeofday(struct timeval *tv, ...) { +#if defined(__USE_TIME_BITS64) + extern int __gettimeofday64(struct timeval *, ...); + return __gettimeofday64(tv, NULL); +#else extern int __gettimeofday(struct timeval *, ...); return __gettimeofday(tv, NULL); +#endif } /* provide a function to hide the libc weak alias */