Patchwork linux-user/syscall.c: fix select on x86_64

login
register
mail settings
Submitter Nickolai Zeldovich
Date Jan. 3, 2013, 9:32 a.m.
Message ID <1357205540-20597-1-git-send-email-nickolai@csail.mit.edu>
Download mbox | patch
Permalink /patch/209199/
State New
Headers show

Comments

Nickolai Zeldovich - Jan. 3, 2013, 9:32 a.m.
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(-)

Patch

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: