From: Lukasz Majewski <lukma@denx.de>
To: Joseph Myers <joseph@codesourcery.com>,
Paul Eggert <eggert@cs.ucla.edu>,
Adhemerval Zanella <adhemerval.zanella@linaro.org>,
Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: Alistair Francis <alistair23@gmail.com>,
Alistair Francis <alistair.francis@wdc.com>,
GNU C Library <libc-alpha@sourceware.org>,
Siddhesh Poyarekar <siddhesh@gotplt.org>,
Florian Weimer <fweimer@redhat.com>,
Florian Weimer <fw@deneb.enyo.de>,
Zack Weinberg <zackw@panix.com>,
Carlos O'Donell <carlos@redhat.com>,
Andreas Schwab <schwab@suse.de>, Lukasz Majewski <lukma@denx.de>
Subject: [PATCH 3/6] y2038: Introduce struct __timeval64 - new internal glibc type
Date: Sat, 18 Jan 2020 07:21:00 -0000 [thread overview]
Message-ID: <20200118072047.23071-4-lukma@denx.de> (raw)
In-Reply-To: <20200118072047.23071-1-lukma@denx.de>
This type is a glibc's "internal" type similar to struct timeval but
whose tv_sec field is a __time64_t rather than a time_t, which makes it
Y2038-proof. This struct is NOT supposed to be passed to the kernel -
instead it shall be converted to struct __timespec64 and clock_[sg]ettime
syscalls shall be used (which are now Y2038 safe).
Build tests:
./src/scripts/build-many-glibcs.py glibcs
---
include/time.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/time.h b/include/time.h
index 047f431a1a..22ecacd0d8 100644
--- a/include/time.h
+++ b/include/time.h
@@ -93,6 +93,20 @@ 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 */
+ __suseconds_t tv_usec; /* Microseconds */
+};
+#endif
+
#if __TIMESIZE == 64
# define __ctime64 ctime
#else
--
2.20.1
next prev parent reply other threads:[~2020-01-18 7:21 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-18 7:34 [PATCH 0/6] y2038: Convert settimeofday to be Y2038 safe Lukasz Majewski
2020-01-18 7:21 ` [PATCH 2/6] y2038: hurd: Provide __clock_settime64 function Lukasz Majewski
2020-01-20 17:12 ` Adhemerval Zanella
2020-01-20 18:10 ` Lukasz Majewski
2020-01-20 18:29 ` Adhemerval Zanella
2020-01-21 16:46 ` Lukasz Majewski
2020-01-21 17:22 ` Adhemerval Zanella
2020-01-21 17:25 ` Samuel Thibault
2020-01-28 0:36 ` Samuel Thibault
2020-01-18 7:21 ` Lukasz Majewski [this message]
2020-01-18 22:49 ` [PATCH 3/6] y2038: Introduce struct __timeval64 - new internal glibc type Alistair Francis
2020-01-19 15:22 ` Arnd Bergmann
2020-01-19 15:39 ` Lukasz Majewski
2020-01-19 21:30 ` Arnd Bergmann
2020-01-20 2:12 ` Lukasz Majewski
2020-01-20 13:01 ` Lukasz Majewski
2020-01-20 13:03 ` Arnd Bergmann
2020-01-20 16:58 ` Adhemerval Zanella
2020-01-20 19:25 ` Arnd Bergmann
2020-01-21 16:55 ` Lukasz Majewski
2020-01-21 17:31 ` Adhemerval Zanella
2020-01-21 22:02 ` Lukasz Majewski
2020-01-18 7:21 ` [PATCH 6/6] y2038: linux: Provide __settimeofday64 implementation Lukasz Majewski
2020-01-19 1:13 ` Alistair Francis
2020-01-18 7:21 ` [PATCH 4/6] y2038: alpha: Rename valid_timeval_to_timeval64 to valid_timeval32_to_timeval Lukasz Majewski
2020-01-18 23:03 ` Alistair Francis
2020-01-18 7:21 ` [PATCH 1/6] y2038: Use __clock_settime64 in deprecated stime function Lukasz Majewski
2020-01-20 17:01 ` Adhemerval Zanella
2020-01-20 18:01 ` Lukasz Majewski
2020-01-20 18:26 ` Adhemerval Zanella
2020-01-21 17:16 ` Lukasz Majewski
2020-01-21 17:20 ` Adhemerval Zanella
2020-01-18 7:21 ` [PATCH 5/6] y2038: Provide conversion helpers for struct __timeval64 Lukasz Majewski
2020-01-18 23:47 ` Alistair Francis
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=20200118072047.23071-4-lukma@denx.de \
--to=lukma@denx.de \
--cc=adhemerval.zanella@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=alistair23@gmail.com \
--cc=carlos@redhat.com \
--cc=eggert@cs.ucla.edu \
--cc=fw@deneb.enyo.de \
--cc=fweimer@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=samuel.thibault@ens-lyon.org \
--cc=schwab@suse.de \
--cc=siddhesh@gotplt.org \
--cc=zackw@panix.com \
/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).