This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/3] y2038: Introduce struct __utimbuf64 - new internal glibc type
- From: Lukasz Majewski <lukma at denx dot de>
- To: Joseph Myers <joseph at codesourcery dot com>, Paul Eggert <eggert at cs dot ucla dot edu>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Cc: Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Siddhesh Poyarekar <siddhesh at gotplt dot org>, Florian Weimer <fweimer at redhat dot com>, Florian Weimer <fw at deneb dot enyo dot de>, Zack Weinberg <zackw at panix dot com>, Carlos O'Donell <carlos at redhat dot com>, Andreas Schwab <schwab at suse dot de>, Lukasz Majewski <lukma at denx dot de>
- Date: Fri, 7 Feb 2020 14:00:07 +0100
- Subject: [PATCH 1/3] y2038: Introduce struct __utimbuf64 - new internal glibc type
- References: <20200207130009.19396-1-lukma@denx.de>
This type is a glibc's "internal" type to store file's access and modification
times in __time64_t rather than __time_t, which makes it Y2038-proof.
Build tests:
./src/scripts/build-many-glibcs.py glibcs
---
include/time.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/time.h b/include/time.h
index 389355a5a5..e38f5e32e6 100644
--- a/include/time.h
+++ b/include/time.h
@@ -109,6 +109,18 @@ struct __timeval64
};
#endif
+#if __TIMESIZE == 64
+# define __utimbuf64 utimbuf
+#else
+/* The glibc Y2038-proof struct __utimbuf64 structure for file's access
+ and modification time values. */
+struct __utimbuf64
+{
+ __time64_t actime; /* Access time. */
+ __time64_t modtime; /* Modification time. */
+};
+#endif
+
#if __TIMESIZE == 64
# define __itimerval64 itimerval
#else
--
2.20.1