qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user/syscall.c: fix select on x86_64
@ 2013-01-03  9:32 Nickolai Zeldovich
  0 siblings, 0 replies; only message in thread
From: Nickolai Zeldovich @ 2013-01-03  9:32 UTC (permalink / raw)
  To: qemu-devel; +Cc: Nickolai Zeldovich, Riku Voipio

Use the correct argument passing convention for select on x86_64.
Previously, select worked for i386 but was broken for x86_64 (always
returning EINVAL).  With this change, select works on both i386 and
x86_64.  (Other targets untested but should be unaffected.)

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
---
 linux-user/syscall.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index e99adab..5a81d9f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6213,7 +6213,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             ret = get_errno(settimeofday(&tv, NULL));
         }
         break;
-#if defined(TARGET_NR_select) && !defined(TARGET_S390X) && !defined(TARGET_S390)
+#if defined(TARGET_NR_select) && !defined(TARGET_S390X) \
+    && !defined(TARGET_S390) && !defined(TARGET_X86_64)
     case TARGET_NR_select:
         {
             struct target_sel_arg_struct *sel;
@@ -7153,8 +7154,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
         }
         break;
 #endif /* TARGET_NR_getdents64 */
-#if defined(TARGET_NR__newselect) || defined(TARGET_S390X)
-#ifdef TARGET_S390X
+#if defined(TARGET_NR__newselect) || defined(TARGET_S390X) \
+    || defined(TARGET_X86_64)
+#if defined(TARGET_S390X) || defined(TARGET_X86_64)
     case TARGET_NR_select:
 #else
     case TARGET_NR__newselect:
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-03  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-03  9:32 [Qemu-devel] [PATCH] linux-user/syscall.c: fix select on x86_64 Nickolai Zeldovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).