aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/mmap.c
diff options
context:
space:
mode:
authorblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-29 14:05:16 +0000
committerblueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162>2008-11-29 14:05:16 +0000
commit6c173b3c09548fd5cd82de08646dfe939ec9416e (patch)
tree7edeb65653fe32ce4fcffa32a22800678c8d113e /bsd-user/mmap.c
parentee50add9255bae635bce87263d83236851bd7cfe (diff)
downloadqemu-6c173b3c09548fd5cd82de08646dfe939ec9416e.zip
qemu-6c173b3c09548fd5cd82de08646dfe939ec9416e.tar.gz
qemu-6c173b3c09548fd5cd82de08646dfe939ec9416e.tar.bz2
Prepare for handling different BSD mmap() flags
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5809 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'bsd-user/mmap.c')
-rw-r--r--bsd-user/mmap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bsd-user/mmap.c b/bsd-user/mmap.c
index 754268c..94c5fbe 100644
--- a/bsd-user/mmap.c
+++ b/bsd-user/mmap.c
@@ -27,6 +27,7 @@
#include "qemu.h"
#include "qemu-common.h"
+#include "bsd-mman.h"
//#define DEBUG_MMAP
@@ -223,7 +224,7 @@ static int mmap_frag(abi_ulong real_start,
if (!(flags & MAP_ANON)) {
/* msync() won't work here, so we return an error if write is
possible while it is a shared mapping */
- if ((flags & MAP_FLAGMASK) == MAP_SHARED &&
+ if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
(prot & PROT_WRITE))
return -EINVAL;
@@ -323,7 +324,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
printf("MAP_FIXED ");
if (flags & MAP_ANON)
printf("MAP_ANON ");
- switch(flags & MAP_FLAGMASK) {
+ switch(flags & TARGET_BSD_MAP_FLAGMASK) {
case MAP_PRIVATE:
printf("MAP_PRIVATE ");
break;
@@ -331,7 +332,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
printf("MAP_SHARED ");
break;
default:
- printf("[MAP_FLAGMASK=0x%x] ", flags & MAP_FLAGMASK);
+ printf("[MAP_FLAGMASK=0x%x] ", flags & TARGET_BSD_MAP_FLAGMASK);
break;
}
printf("fd=%d offset=" TARGET_FMT_lx "\n", fd, offset);
@@ -396,7 +397,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
(offset & ~qemu_host_page_mask) != (start & ~qemu_host_page_mask)) {
/* msync() won't work here, so we return an error if write is
possible while it is a shared mapping */
- if ((flags & MAP_FLAGMASK) == MAP_SHARED &&
+ if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
(prot & PROT_WRITE)) {
errno = EINVAL;
goto fail;