Commit 7cbab5b1 authored by Michael Tokarev's avatar Michael Tokarev
Browse files

use int for sparc64 timeval.tv_usec (#920032)

parent d890e9de
......@@ -3,3 +3,4 @@ do-not-link-everything-with-xen.patch
From: Ben Hutchings <>
Date: Wed, 6 Feb 2019 11:35:06 +0300
Subject: sparc64 timeval.tv_usec is int
On sparc (only) Linux defines timeval::tv_usec with type int, not
long. However qemu-user's definition of struct target_timeval uses
abi_long unconditionally. This results in the syscall translation
layer effectively multiplying tv_usec by 2**32. All sparc syscalls
passing non-zero values for this field fail with -EINVAL.
Laurent Vivier <>:
According to the kernel definition, I think it should be:
See arch/sparc/include/uapi/asm/posix_types.h
typedef int __kernel_suseconds_t;
linux-user/syscall_defs.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 99bbce083c..106eafe7fc 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -210,7 +210,11 @@ struct target_linger {
struct target_timeval {
abi_long tv_sec;
+#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32)
+ abi_int tv_usec;
abi_long tv_usec;
struct target_timespec {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment