Skip to contentSkip to conversation

5/5: no need (?) for a dummy file on FreeBSD too

PATCH New Juergen Lock 1 participant 1 message Oct 1, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 5/5: no need (?) for a dummy file on FreeBSD too

..like on OpenBSD

Index: qemu/osdep.c
@@ -75,8 +75,10 @@
#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 +87,7 @@

     static int phys_ram_size = 0;
     void *ptr;

-#ifdef __OpenBSD__ /* no need (?) for a dummy file on OpenBSD */
+#if defined(__OpenBSD__) || defined(__FreeBSD__) /* no need (?) for a dummy file on OpenBSD/FreeBSD */

     int map_anon = MAP_ANON;
 #else
     int map_anon = 0;
@@ -154,7 +154,7 @@
     }
     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,