public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Alistair Francis <alistair23@gmail.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	GNU C Library <libc-alpha@sourceware.org>,
	Florian Weimer <fweimer@redhat.com>,
	Andreas Schwab <schwab@suse.de>, Lukasz Majewski <lukma@denx.de>
Subject: [PATCH 01/10] y2038: include: Move struct __timeval64 definition to a separate file
Date: Sun, 26 Apr 2020 15:31:01 +0200	[thread overview]
Message-ID: <20200426133110.5312-2-lukma@denx.de> (raw)
In-Reply-To: <20200426133110.5312-1-lukma@denx.de>

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.
---
 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 <bits/types/struct_timeval.h>
 # include <struct___timespec64.h>
+# include <struct___timeval64.h>
 # include <bits/types/locale_t.h>
 # include <stdbool.h>
 # include <time/mktime-internal.h>
@@ -73,20 +74,6 @@ struct __itimerspec64
 };
 #endif
 
-#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
-
 #if __TIMESIZE == 64
 # define __utimbuf64 utimbuf
 # define __itimerval64 itimerval
-- 
2.20.1


  reply	other threads:[~2020-04-26 13:31 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 13:31 [PATCH 00/10] y2038: Convert clock_adjtime related syscalls to support 64 bit time Lukasz Majewski
2020-04-26 13:31 ` Lukasz Majewski [this message]
2020-04-27 15:18   ` [PATCH 01/10] y2038: include: Move struct __timeval64 definition to a separate file Alistair Francis
2020-04-28 14:24   ` Adhemerval Zanella
2020-04-26 13:31 ` [PATCH 02/10] y2038: Introduce struct __timex64 - new internal glibc type Lukasz Majewski
2020-04-27 15:22   ` Alistair Francis
2020-04-28 14:34   ` Adhemerval Zanella
2020-04-29 21:45     ` Lukasz Majewski
2020-04-26 13:31 ` [PATCH 03/10] y2038: Provide conversion helpers for struct __timex64 Lukasz Majewski
2020-04-27 15:22   ` Alistair Francis
2020-04-28 15:56   ` Adhemerval Zanella
2020-04-26 13:31 ` [PATCH 04/10] y2038: linux: Provide __clock_adjtime64 implementation Lukasz Majewski
2020-04-27 22:12   ` Alistair Francis
2020-04-28 17:00   ` Adhemerval Zanella
2020-04-29 21:43     ` Lukasz Majewski
2020-04-26 13:31 ` [PATCH 05/10] y2038: linux: Provide ___adjtimex64 implementation Lukasz Majewski
2020-04-27 22:12   ` Alistair Francis
2020-04-28 17:14   ` Adhemerval Zanella
2020-04-26 13:31 ` [PATCH 06/10] y2038: linux: Provide __adjtime64 implementation Lukasz Majewski
2020-04-27 22:14   ` Alistair Francis
2020-04-28 18:33   ` Adhemerval Zanella
2020-04-26 13:31 ` [PATCH 07/10] y2038: Introduce struct __ntptimeval64 - new internal glibc type Lukasz Majewski
2020-04-28 18:41   ` Adhemerval Zanella
2020-04-29 21:28     ` Lukasz Majewski
2020-05-07 18:32       ` Lukasz Majewski
2020-04-26 13:31 ` [PATCH 08/10] y2038: Provide conversion helpers for struct __ntptimeval64 Lukasz Majewski
2020-04-26 13:31 ` [PATCH 09/10] y2038: linux: Provide __ntp_gettime64 implementation Lukasz Majewski
2020-04-26 13:31 ` [PATCH 10/10] y2038: linux: Provide __ntp_gettimex64 implementation Lukasz Majewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200426133110.5312-2-lukma@denx.de \
    --to=lukma@denx.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=alistair23@gmail.com \
    --cc=fweimer@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).