From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 6C9EB393C03B; Mon, 1 Mar 2021 17:37:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C9EB393C03B Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/y2038] y2038: Add __USE_TIME_BITS64 support for struct timespec X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/azanella/y2038 X-Git-Oldrev: cee329fc01161376263a5f65ba36b74cc3a67c05 X-Git-Newrev: 5a6f282b68a4c921dabf82a5d8f8b8e9d94c8326 Message-Id: <20210301173754.6C9EB393C03B@sourceware.org> Date: Mon, 1 Mar 2021 17:37:54 +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: Mon, 01 Mar 2021 17:37:54 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5a6f282b68a4c921dabf82a5d8f8b8e9d94c8326 commit 5a6f282b68a4c921dabf82a5d8f8b8e9d94c8326 Author: Adhemerval Zanella Date: Wed Feb 17 16:19:45 2021 -0300 y2038: Add __USE_TIME_BITS64 support for struct timespec The __USE_TIME_BITS64 is not defined internally yet. Diff: --- time/bits/types/struct_timespec.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/time/bits/types/struct_timespec.h b/time/bits/types/struct_timespec.h index d11c69cfd3..4fe47a0d25 100644 --- a/time/bits/types/struct_timespec.h +++ b/time/bits/types/struct_timespec.h @@ -1,18 +1,22 @@ -/* NB: Include guard matches what uses. */ -#ifndef _STRUCT_TIMESPEC -#define _STRUCT_TIMESPEC 1 +#ifndef __struct_timespec_defined +#define __struct_timespec_defined 1 #include #include +#include /* POSIX.1b structure for a time value. This is like a `struct timeval' but has nanoseconds instead of microseconds. */ struct timespec { +#ifdef __USE_TIME_BITS64 + __time64_t tv_sec; /* Seconds. */ +#else __time_t tv_sec; /* Seconds. */ +#endif #if __WORDSIZE == 64 \ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \ - || __TIMESIZE == 32 + || (__TIMESIZE == 32 && !defined __USE_TIME_BITS64) __syscall_slong_t tv_nsec; /* Nanoseconds. */ #else # if __BYTE_ORDER == __BIG_ENDIAN