From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2076) id 518993890C0A; Tue, 5 May 2020 22:57:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 518993890C0A 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: include: Move struct __timeval64 definition to a separate file X-Act-Checkin: glibc X-Git-Author: Lukasz Majewski X-Git-Refname: refs/heads/master X-Git-Oldrev: 481d01fa2b07d3c6f9e6ef9ae239bc616b1ac757 X-Git-Newrev: a308615f7c067371df8bd96cb233cd0574537863 Message-Id: <20200505225758.518993890C0A@sourceware.org> Date: Tue, 5 May 2020 22:57:58 +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:58 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a308615f7c067371df8bd96cb233cd0574537863 commit a308615f7c067371df8bd96cb233cd0574537863 Author: Lukasz Majewski Date: Tue Apr 21 19:01:56 2020 +0200 y2038: include: Move struct __timeval64 definition to a separate file The struct __timeval64's definition has been moved from ./include/time.h to ./include/struct___timeval64.h. This change would prevent from polluting other glibc namespaces (when headers are modified to support 64 bit time on architectures with __WORDSIZE==32). Now it is possible to just include definition of this particular structure when needed. Reviewed-by: Alistair Francis Reviewed-by: Adhemerval Zanella Diff: --- include/struct___timeval64.h | 17 +++++++++++++++++ include/time.h | 15 +-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/include/struct___timeval64.h b/include/struct___timeval64.h new file mode 100644 index 0000000000..05cf2f26fc --- /dev/null +++ b/include/struct___timeval64.h @@ -0,0 +1,17 @@ +#ifndef _STRUCT_TIMEVAL64_H +#define _STRUCT_TIMEVAL64_H + +#if __TIMESIZE == 64 +# define __timeval64 timeval +#else +/* The glibc Y2038-proof struct __timeval64 structure for a time value. + This structure is NOT supposed to be passed to the Linux kernel. + Instead, it shall be converted to struct __timespec64 and time shall + be [sg]et via clock_[sg]ettime (which are now Y2038 safe). */ +struct __timeval64 +{ + __time64_t tv_sec; /* Seconds */ + __suseconds64_t tv_usec; /* Microseconds */ +}; +#endif +#endif /* _STRUCT_TIMEVAL64_H */ diff --git a/include/time.h b/include/time.h index 1c103a4cb2..fe4da9ca10 100644 --- a/include/time.h +++ b/include/time.h @@ -4,6 +4,7 @@ #ifndef _ISOMAC # include # include +# include # include # include # include