[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] amd64 compile
From: |
J. Mayer |
Subject: |
Re: [Qemu-devel] amd64 compile |
Date: |
Sun, 25 Apr 2004 21:46:13 +0200 |
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 <address@hidden>
Never organized
[Qemu-devel] Re: amd64 compile, Gabriel Ebner, 2004/04/25