From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2076) id 15BF7389087D; Tue, 5 May 2020 22:57:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 15BF7389087D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Lukasz Majewski To: glibc-cvs@sourceware.org Subject: [glibc] y2038: inet: Convert inet deadline to support 64 bit time X-Act-Checkin: glibc X-Git-Author: Lukasz Majewski X-Git-Refname: refs/heads/master X-Git-Oldrev: 1959ed4b9e9f95c991abdf31b24fb8cdf98475e2 X-Git-Newrev: e008836c4afeeb81abe548b898fdf2db7d70eaff Message-Id: <20200505225748.15BF7389087D@sourceware.org> Date: Tue, 5 May 2020 22:57:48 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2020 22:57:48 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=e008836c4afeeb81abe548b898fdf2db7d70eaff commit e008836c4afeeb81abe548b898fdf2db7d70eaff Author: Lukasz Majewski Date: Mon Mar 16 10:09:13 2020 +0100 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 Diff: --- inet/deadline.c | 4 ++-- inet/net-internal.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/inet/deadline.c b/inet/deadline.c index ebf9a4f52c..eac7afd1a8 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; } diff --git a/inet/net-internal.h b/inet/net-internal.h index 3ca301a9be..50c7e1c482 100644 --- a/inet/net-internal.h +++ b/inet/net-internal.h @@ -24,6 +24,7 @@ #include #include #include +#include int __inet6_scopeid_pton (const struct in6_addr *address, const char *scope, uint32_t *result); @@ -76,7 +77,7 @@ enum idna_name_classification __idna_name_classify (const char *name) timeouts and vice versa. */ struct deadline_current_time { - struct timespec current; + struct __timespec64 current; }; /* Return the current time. Terminates the process if the current @@ -86,7 +87,7 @@ struct deadline_current_time __deadline_current_time (void) attribute_hidden; /* Computed absolute deadline. */ struct deadline { - struct timespec absolute; + struct __timespec64 absolute; };