From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHpWk-0004e2-Lo for qemu-devel@nongnu.org; Sun, 25 Apr 2004 15:42:58 -0400 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHpWE-00047t-8l for qemu-devel@nongnu.org; Sun, 25 Apr 2004 15:42:57 -0400 Received: from [62.210.158.41] (helo=moscou.magic.fr) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHpV5-0003TG-6s for qemu-devel@nongnu.org; Sun, 25 Apr 2004 15:41:15 -0400 Received: from [10.0.0.2] (ppp-181.net-555.magic.fr [62.210.255.181]) by moscou.magic.fr (8.11.6/8.10.1) with ESMTP id i3PJf5D09528 for ; Sun, 25 Apr 2004 21:41:05 +0200 (CEST) Subject: Re: [Qemu-devel] amd64 compile From: "J. Mayer" In-Reply-To: <408C0B60.8030906@bellard.org> References: <1082917248.14652.7.camel@rapid> <1082918435.14634.11.camel@rapid> <408C0B60.8030906@bellard.org> Content-Type: text/plain Message-Id: <1082922373.14634.102.camel@rapid> Mime-Version: 1.0 Date: Sun, 25 Apr 2004 21:46:13 +0200 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Sun, 2004-04-25 at 21:02, Fabrice Bellard wrote: > From the kernel sources, _llseek is handled the same on every arch > (linux/fs/read_write.c). So there must be another problem. Oh well, you're right. I absolutely wanted to use llseek, and I didn't noticed the way it's defined in syscall.c, which is buggy, at least for amd64. lseek is 3 args for amd64, not 5 and there is no llseek syscall at all. This patch gets it right: Index: linux-user/syscall.c =================================================================== RCS file: /cvsroot/qemu/qemu/linux-user/syscall.c,v retrieving revision 1.47 diff -u -d -w -B -b -d -p -r1.47 syscall.c --- linux-user/syscall.c 12 Apr 2004 20:39:29 -0000 1.47 +++ linux-user/syscall.c 25 Apr 2004 19:39:10 -0000 @@ -2402,9 +2402,14 @@ long do_syscall(void *cpu_env, int num, goto unimplemented; case TARGET_NR__llseek: { +#if defined (__x86_64__) + ret = get_errno(lseek(arg1, ((uint64_t )arg2 << 32) | arg3, arg5)); + *(int64_t *)arg4 = ret; +#else int64_t res; ret = get_errno(_llseek(arg1, arg2, arg3, &res, arg5)); *(int64_t *)arg4 = tswap64(res); +#endif } break; case TARGET_NR_getdents: -- J. Mayer Never organized