From e008836c4afeeb81abe548b898fdf2db7d70eaff Mon Sep 17 00:00:00 2001 From: Lukasz Majewski Date: Mon, 16 Mar 2020 10:09:13 +0100 Subject: y2038: inet: Convert inet deadline to support 64 bit time This change brings 64 bit time support to inet deadline related code for architectures with __WORDSIZE == 32 && __TIMESIZE != 64. It is also safe to replace struct timespec with struct __timespec64 in deadline related structures as: - The __deadline_to_ms () returns the number of miliseconds to deadline to be used with __poll (and hence it is a relative value). - To calculate the deadline from timeval (which will be converted latter) the uintmax_t type is used (unsinged long long int). Reviewed-by: Adhemerval Zanella --- inet/deadline.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inet/deadline.c') diff --git a/inet/deadline.c b/inet/deadline.c index ebf9a4f..eac7afd 100644 --- a/inet/deadline.c +++ b/inet/deadline.c @@ -28,8 +28,8 @@ struct deadline_current_time __deadline_current_time (void) { struct deadline_current_time result; - if (__clock_gettime (CLOCK_MONOTONIC, &result.current) != 0) - __clock_gettime (CLOCK_REALTIME, &result.current); + if (__clock_gettime64 (CLOCK_MONOTONIC, &result.current) != 0) + __clock_gettime64 (CLOCK_REALTIME, &result.current); assert (result.current.tv_sec >= 0); return result; } -- cgit v1.1