This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC v6 06/23] sysdeps: Use long types with 64-bit time_t on 32-bit archs


If we are using a 32-bit architecture with a 64-bit time_t let's
define __SEM_PAD_BEFORE_TIME as 1. This is because the kernel is
expecting a type __kernel_old_time_t which is 32-bit even with a
64-bit time_t. Instead of adding another check, let's just set
__SEM_PAD_BEFORE_TIME as that will use a long type instead of
long long.
---
 sysdeps/unix/sysv/linux/bits/sem-pad.h | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/bits/sem-pad.h b/sysdeps/unix/sysv/linux/bits/sem-pad.h
index 566ce039cc..4b419a6100 100644
--- a/sysdeps/unix/sysv/linux/bits/sem-pad.h
+++ b/sysdeps/unix/sysv/linux/bits/sem-pad.h
@@ -30,4 +30,15 @@
    layout conversions for this structure.  */
 
 #define __SEM_PAD_AFTER_TIME (__TIMESIZE == 32)
-#define __SEM_PAD_BEFORE_TIME 0
+
+/* If we are using a 32-bit architecture with a 64-bit time_t let's
+   define __SEM_PAD_BEFORE_TIME as 1. This is because the kernel is
+   expecting a type __kernel_old_time_t which is 32-bit even with a
+   64-bit time_t. Instead of adding another check, let's just set
+   __SEM_PAD_BEFORE_TIME as that will use a long type instead of
+   long long.  */
+#if __WORDSIZE == 32 && __TIMESIZE == 64
+# define __SEM_PAD_BEFORE_TIME 1
+#else
+# define __SEM_PAD_BEFORE_TIME 0
+#endif
-- 
2.24.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]