Piotr Caban : ntdll: Use 32-bit time_t when calling __NR_futex syscall.
Alexandre Julliard
julliard at winehq.org
Tue Apr 26 16:25:27 CDT 2022
Module: wine
Branch: master
Commit: 4ec67b7a6447dfc4af8c03c141c600b41b90ef53
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4ec67b7a6447dfc4af8c03c141c600b41b90ef53
Author: Piotr Caban <piotr at codeweavers.com>
Date: Mon Apr 25 21:23:38 2022 +0200
ntdll: Use 32-bit time_t when calling __NR_futex syscall.
Signed-off-by: Piotr Caban <piotr at codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/unix/sync.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
index 1695e6ed570..1194ee514b5 100644
--- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -111,6 +111,17 @@ static int futex_private = 128;
static inline int futex_wait( const int *addr, int val, struct timespec *timeout )
{
+#if (defined(__i386__) || defined(__arm__)) && _TIME_BITS==64
+ if (timeout && sizeof(*timeout) != 8)
+ {
+ struct {
+ long tv_sec;
+ long tv_nsec;
+ } timeout32 = { timeout->tv_sec, timeout->tv_nsec };
+
+ return syscall( __NR_futex, addr, FUTEX_WAIT | futex_private, val, &timeout32, 0, 0 );
+ }
+#endif
return syscall( __NR_futex, addr, FUTEX_WAIT | futex_private, val, timeout, 0, 0 );
}
More information about the wine-cvs
mailing list