ntdll: Use 32-bit time_t when calling __NR_futex syscall.

Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Piotr Caban 2022-04-25 21:23:38 +02:00 committed by Alexandre Julliard
parent 730b35ba46
commit 4ec67b7a64
1 changed files with 11 additions and 0 deletions

View File

@ -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 );
}