This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC v2 04/20] include/time.h: Fix conflicting timespec types on 32-bit


On 32-bit systems with 64-bit time_t the timespec variable will be set
to struct __timespec64 which doesn't match the expected function pointer
for __clock_settime64.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 include/time.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/time.h b/include/time.h
index 7155b2e4db..d62fc7b2c3 100644
--- a/include/time.h
+++ b/include/time.h
@@ -53,7 +53,8 @@ extern void __tz_compute (__time64_t timer, struct tm *tm, int use_localtime)
   __THROW attribute_hidden;
 
 #if __WORDSIZE == 64 \
-  || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64)
+  || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
+  || __TIMESIZE == 64
 # define __timespec64 timespec
 #else
 /* The glibc Y2038-proof struct __timespec64 structure for a time value.
-- 
2.22.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]