This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC v2 04/20] include/time.h: Fix conflicting timespec types on 32-bit
- From: Alistair Francis <alistair dot francis at wdc dot com>
- To: libc-alpha at sourceware dot org
- Cc: arnd at arndb dot de, adhemerval dot zanella at linaro dot org, fweimer at redhat dot com, palmer at sifive dot com, macro at wdc dot com, zongbox at gmail dot com, zong at andestech dot com, alistair dot francis at wdc dot com, alistair23 at gmail dot com
- Date: Mon, 24 Jun 2019 17:08:55 -0700
- Subject: [RFC v2 04/20] include/time.h: Fix conflicting timespec types on 32-bit
- Ironport-sdr: n44Y8C1Sc8oICw3K/J6beciVHzmKGgKf69MrtaSeXbj/f9QqDHfbb3k2ttQTyEeqFoG0FtzcUx rTv2Aap0MH0/u4ylSS/kR7yU/wwJvQOMQnCgXeSrWn94FchKj2DfOfYVs98Kigxd9eptbFArul P8rscjlYlfnKGrVI0nQdtNhy4//Z8Ys7TkDK2nN0C7n4bipT44+OnhgXVaTOnEfjD/vBwO/3bp mBckAC8EPQ/df0C18YlvA46QC26ct25iIev/qTEZ2C7Yx+foDp9UDOEASdkPt2kFvS+4KZ0rVG 22w4P9DROAKCdJT8+Ect+/Bn
- Ironport-sdr: DX/XFmK7ZIH3VXxiEXPYB03zmp4c6yvbDEsEBM+J8eqxxk7npRDVRaYlgoaujNmlq8MZcgE4Py 7dbwQxbNBR5DZpsiF03LIyTqgLFREmohsjCbx8MTzqXKlA5rZVE1+r4yx829dvqUf6GisEA3Ez hphSWAefrUaNHvSoBEcunrbBxDQZ8F/eq4t61sCExqb53FLIV7bUpG5T+p5UDDEZurI6hSsZws 3VkMP2j9LpUgFW1HAtlehWTBYZjAVWCKWwL7o2I8B3J2ZcAuKYsrkUeZYCOx0YBrCtq6yrKE06 mBM=
- References: <cover.1561421042.git.alistair.francis@wdc.com>
On 32-bit systems with 64-bit time_t the timespec variable will be set
to struct __timespec64 which doesn't match the expected function pointer
for __clock_settime64.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
include/time.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/time.h b/include/time.h
index 7155b2e4db..d62fc7b2c3 100644
--- a/include/time.h
+++ b/include/time.h
@@ -53,7 +53,8 @@ extern void __tz_compute (__time64_t timer, struct tm *tm, int use_localtime)
__THROW attribute_hidden;
#if __WORDSIZE == 64 \
- || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64)
+ || (defined __SYSCALL_WORDSIZE && __SYSCALL_WORDSIZE == 64) \
+ || __TIMESIZE == 64
# define __timespec64 timespec
#else
/* The glibc Y2038-proof struct __timespec64 structure for a time value.
--
2.22.0