qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "J. Mayer" <l_indien@magic.fr>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] amd64 compile
Date: Sun, 25 Apr 2004 21:46:13 +0200	[thread overview]
Message-ID: <1082922373.14634.102.camel@rapid> (raw)
In-Reply-To: <408C0B60.8030906@bellard.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 <l_indien@magic.fr>
Never organized

  reply	other threads:[~2004-04-25 19:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-25 15:32 [Qemu-devel] amd64 compile Martin Garton
2004-04-25 16:07 ` J. Mayer
2004-04-25 16:23   ` Martin Garton
2004-04-25 18:20     ` J. Mayer
2004-04-25 18:40       ` J. Mayer
2004-04-25 19:02         ` Fabrice Bellard
2004-04-25 19:46           ` J. Mayer [this message]
2004-04-25 17:46   ` [Qemu-devel] " Gabriel Ebner
2004-04-25 18:09     ` J. Mayer
2004-04-25 18:38       ` [Qemu-devel] " Gabriel Ebner
2004-04-25 18:52         ` J. Mayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1082922373.14634.102.camel@rapid \
    --to=l_indien@magic.fr \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).