[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] linux-user mremap()
From: |
Vince Weaver |
Subject: |
[Qemu-devel] linux-user mremap() |
Date: |
Fri, 26 Sep 2008 14:24:43 -0400 (EDT) |
Until the linux-user mremap() problem is fixed (the one where a 64-bit
value can be returned even on a 32-bit target), might it make sense to
apply a patch like this?
This will at least let users know what the problem is, instead of just
segfaulting.
Vince
Index: mmap.c
===================================================================
--- mmap.c (revision 5321)
+++ mmap.c (working copy)
@@ -538,6 +538,13 @@
mmap_lock();
/* XXX: use 5 args syscall */
host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
+#if TARGET_ABI_BITS == 32
+ if (host_addr > 0xffffffff) {
+ printf("ERROR! mremap() returned 64-bit value on 32-bit target!\n\n");
+ exit(-1);
+ }
+#endif
+
if (host_addr == -1) {
new_addr = -1;
} else {
- [Qemu-devel] linux-user mremap(),
Vince Weaver <=