Alexandre Julliard : ntdll: Use MAP_SHARED also for read-only mappings.
Alexandre Julliard
julliard at winehq.org
Tue Feb 6 15:55:50 CST 2018
Module: wine
Branch: master
Commit: b1f8a91e6c1f9bf5524eb130a912fb8727f258ff
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b1f8a91e6c1f9bf5524eb130a912fb8727f258ff
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Feb 6 10:43:12 2018 +0100
ntdll: Use MAP_SHARED also for read-only mappings.
This essentially reverts commit dac252ecb42fb17c2f3f2deb559262514b58e990.
It's necessary for macOS.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/virtual.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 534daf9..426af01 100644
--- a/dlls/ntdll/virtual.c
+++ b/dlls/ntdll/virtual.c
@@ -1146,7 +1146,7 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start
{
void *ptr;
int prot = VIRTUAL_GetUnixProt( vprot | VPROT_COMMITTED /* make sure it is accessible */ );
- unsigned int flags = MAP_FIXED | ((vprot & VPROT_WRITE) ? MAP_SHARED : MAP_PRIVATE);
+ unsigned int flags = MAP_FIXED | ((vprot & VPROT_WRITECOPY) ? MAP_PRIVATE : MAP_SHARED);
assert( start < view->size );
assert( start + size <= view->size );
@@ -1171,7 +1171,7 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start
break;
case ENOEXEC:
case ENODEV: /* filesystem doesn't support mmap(), fall back to read() */
- if (flags & MAP_SHARED)
+ if (vprot & VPROT_WRITE)
{
ERR( "shared writable mmap not supported, broken filesystem?\n" );
return STATUS_NOT_SUPPORTED;
More information about the wine-cvs
mailing list