Index: qemu-kvm-0.12.3+noroms/linux-user/syscall.c =================================================================== --- qemu-kvm-0.12.3+noroms.orig/linux-user/syscall.c 2011-02-18 20:11:38.000000000 -0500 +++ qemu-kvm-0.12.3+noroms/linux-user/syscall.c 2011-02-18 20:29:06.000000000 -0500 @@ -5916,12 +5916,15 @@ #ifdef TARGET_NR__llseek /* Not on alpha */ case TARGET_NR__llseek: { + int64_t res; #if defined (__x86_64__) - ret = get_errno(lseek(arg1, ((uint64_t )arg2 << 32) | arg3, arg5)); - if (put_user_s64(ret, arg4)) + res = lseek(arg1, ((uint64_t )arg2 << 32) | arg3, arg5); + ret = 0; + if (res == -1) + ret = get_errno(res); + if (put_user_s64(res, arg4)) goto efault; #else - int64_t res; ret = get_errno(_llseek(arg1, arg2, arg3, &res, arg5)); if (put_user_s64(res, arg4)) goto efault;