aboutsummaryrefslogtreecommitdiff
path: root/osdep.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-22 20:43:01 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-22 20:43:01 +0000
commit5f8712aa1eaeb973baf1f52422ef8eb73ccb258a (patch)
tree0ac28c290ceb6d929a2560999a0c240a3d2c0ff4 /osdep.c
parentcdba95bd96ae74557b8af89c6c1d75c3aebf6f81 (diff)
downloadqemu-5f8712aa1eaeb973baf1f52422ef8eb73ccb258a.zip
qemu-5f8712aa1eaeb973baf1f52422ef8eb73ccb258a.tar.gz
qemu-5f8712aa1eaeb973baf1f52422ef8eb73ccb258a.tar.bz2
Use MAP_ANON also for FreeBSD (Juergen Lock)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5778 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'osdep.c')
-rw-r--r--osdep.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/osdep.c b/osdep.c
index 375b301..aaced11 100644
--- a/osdep.c
+++ b/osdep.c
@@ -75,8 +75,10 @@ void qemu_vfree(void *ptr)
#include <sys/types.h>
#include <sys/mount.h>
#else
+#ifndef __FreeBSD__
#include <sys/vfs.h>
#endif
+#endif
#include <sys/mman.h>
#include <fcntl.h>
@@ -87,7 +89,8 @@ static void *kqemu_vmalloc(size_t size)
static int phys_ram_size = 0;
void *ptr;
-#ifdef __OpenBSD__ /* no need (?) for a dummy file on OpenBSD */
+/* no need (?) for a dummy file on OpenBSD/FreeBSD */
+#if defined(__OpenBSD__) || defined(__FreeBSD__)
int map_anon = MAP_ANON;
#else
int map_anon = 0;
@@ -154,7 +157,7 @@ static void *kqemu_vmalloc(size_t size)
}
size = (size + 4095) & ~4095;
ftruncate(phys_ram_fd, phys_ram_size + size);
-#endif /* !__OpenBSD__ */
+#endif /* !(__OpenBSD__ || __FreeBSD__) */
ptr = mmap(NULL,
size,
PROT_WRITE | PROT_READ, map_anon | MAP_SHARED,