From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by sourceware.org (Postfix) with ESMTPS id 4CDAB38708D6 for ; Mon, 27 Apr 2020 15:26:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4CDAB38708D6 Received: by mail-il1-x144.google.com with SMTP id x2so17066786ilp.13 for ; Mon, 27 Apr 2020 08:26:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lRv/EjT+s8IEtGNx1dfxP1QxJrbWNoAHZCBnsWJL0Mc=; b=WlswAp/k5XUTw51JYv7s+JGEFoK5RZ29haZxLQYnnkOvxEQpYaB58pkSPX1cdDZrk5 G7WnO6Gef7e8pyVA23PuS7dxoxunVmLyc+05cDkVFOvL6yqYihWeW5YjOUKQ3Fmu8P03 pfd+nlZ7ykOREsIt0jzkfYuLjluxWXTmZhLmKm1wo/YVidivlhoTz8Qi/0TD2llHg5BW QhaaT0SdyRlZymIXaiqSCacxAhJhtL+1HCnU5tEEPFTyBpzjh0WE1pwQAqSBa49q0G81 HxaH4+ES9Ks5ZvHGL3NrW52d/aXEkFrPTXAjQojudxzbEmdFsDIH+tiHpRaS7lbMtgzi EdoQ== X-Gm-Message-State: AGi0PuYTk7Fw+uJxJs0KEPUfEFSu/6uAdYNVkz2QBO8SFHPCjrkLVYsb yqT2M+FvumtLldvyXgpR8G9pfXr9RmzjzJ6DRu4= X-Google-Smtp-Source: APiQypKxeEtbDxRv5xUB9NgWYPVjKSxmzkfz5kLf4BPpOb/foa/rMHZLUcbUXdLZ83PWgdzawM+sDP42g9fPSOMoQMU= X-Received: by 2002:a92:aa07:: with SMTP id j7mr2405324ili.40.1588001212789; Mon, 27 Apr 2020 08:26:52 -0700 (PDT) MIME-Version: 1.0 References: <20200426133110.5312-1-lukma@denx.de> <20200426133110.5312-2-lukma@denx.de> In-Reply-To: <20200426133110.5312-2-lukma@denx.de> From: Alistair Francis Date: Mon, 27 Apr 2020 08:18:15 -0700 Message-ID: Subject: Re: [PATCH 01/10] y2038: include: Move struct __timeval64 definition to a separate file To: Lukasz Majewski Cc: Joseph Myers , Adhemerval Zanella , Alistair Francis , GNU C Library , Florian Weimer , Andreas Schwab Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 15:27:03 -0000 On Sun, Apr 26, 2020 at 6:31 AM Lukasz Majewski wrote: > > 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 Alistair > --- > include/struct___timeval64.h | 17 +++++++++++++++++ > include/time.h | 15 +-------------- > 2 files changed, 18 insertions(+), 14 deletions(-) > create mode 100644 include/struct___timeval64.h > > 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