From patchwork Thu Jan 3 09:32:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nickolai Zeldovich X-Patchwork-Id: 209199 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E705D2C008E for ; Thu, 3 Jan 2013 20:32:14 +1100 (EST) Received: from localhost ([::1]:58422 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tqh9p-0006dZ-3V for incoming@patchwork.ozlabs.org; Thu, 03 Jan 2013 04:32:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:52646) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tqh9f-0006dO-04 for qemu-devel@nongnu.org; Thu, 03 Jan 2013 04:32:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tqh9c-0008Rf-72 for qemu-devel@nongnu.org; Thu, 03 Jan 2013 04:32:02 -0500 Received: from outgoing.csail.mit.edu ([128.30.2.149]:48733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tqh9c-0008RU-3o for qemu-devel@nongnu.org; Thu, 03 Jan 2013 04:32:00 -0500 Received: from c-71-232-26-90.hsd1.ma.comcast.net ([71.232.26.90] helo=sahara) by outgoing.csail.mit.edu with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1Tqh9a-0005QP-O6; Thu, 03 Jan 2013 04:31:58 -0500 Received: from nickolai by sahara with local (Exim 4.80) (envelope-from ) id 1TqhAB-0005Mo-FN; Thu, 03 Jan 2013 04:32:35 -0500 From: Nickolai Zeldovich To: qemu-devel@nongnu.org Date: Thu, 3 Jan 2013 04:32:20 -0500 Message-Id: <1357205540-20597-1-git-send-email-nickolai@csail.mit.edu> X-Mailer: git-send-email 1.7.10.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 128.30.2.149 Cc: Nickolai Zeldovich , Riku Voipio Subject: [Qemu-devel] [PATCH] linux-user/syscall.c: fix select on x86_64 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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: