[hurd,commited] hurd: Fix __TIMESIZE on x86_64

Message ID 20230519182550.1542384-1-samuel.thibault@ens-lyon.org
State Committed
Commit 4d3f846b88d307d459a283617778fc11e9bd25ac
Headers
Series [hurd,commited] hurd: Fix __TIMESIZE on x86_64 |

Checks

Context Check Description
dj/TryBot-apply_patch fail Patch failed to apply to master at the time it was sent
dj/TryBot-32bit fail Patch series failed to apply
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed

Commit Message

Samuel Thibault May 19, 2023, 6:25 p.m. UTC
  From: Sergey Bugaev <bugaevc@gmail.com>

We had sizeof (time_t) == 8, but __TIMESIZE == 32.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230519171516.3698754-1-bugaevc@gmail.com>
---
 sysdeps/mach/clock_gettime.c      | 2 ++
 sysdeps/mach/hurd/bits/timesize.h | 4 +++-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Patch

diff --git a/sysdeps/mach/clock_gettime.c b/sysdeps/mach/clock_gettime.c
index be775ed2bb..9124a32ef7 100644
--- a/sysdeps/mach/clock_gettime.c
+++ b/sysdeps/mach/clock_gettime.c
@@ -111,6 +111,7 @@  strong_alias (__clock_gettime, __clock_gettime_2);
 compat_symbol (libc, __clock_gettime_2, clock_gettime, GLIBC_2_2);
 #endif
 
+#if __TIMESIZE != 64
 int
 __clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64)
 {
@@ -124,3 +125,4 @@  __clock_gettime64 (clockid_t clock_id, struct __timespec64 *ts64)
   return ret;
 }
 libc_hidden_def (__clock_gettime64)
+#endif
diff --git a/sysdeps/mach/hurd/bits/timesize.h b/sysdeps/mach/hurd/bits/timesize.h
index 900a0a237d..981452c026 100644
--- a/sysdeps/mach/hurd/bits/timesize.h
+++ b/sysdeps/mach/hurd/bits/timesize.h
@@ -16,5 +16,7 @@ 
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <bits/wordsize.h>
+
 /* Size in bits of the 'time_t' type of the default ABI.  */
-#define __TIMESIZE	32
+#define __TIMESIZE	__WORDSIZE