OSDN Git Service

* mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtect
authorcorinna <corinna>
Wed, 12 Jul 2006 20:15:00 +0000 (20:15 +0000)
committercorinna <corinna>
Wed, 12 Jul 2006 20:15:00 +0000 (20:15 +0000)
on maps created with MAP_NORESERVE.

winsup/cygwin/ChangeLog
winsup/cygwin/mmap.cc

index a91fbf4..0ff39df 100644 (file)
@@ -1,5 +1,10 @@
 2006-07-12  Corinna Vinschen  <corinna@vinschen.de>
 
+       * mmap.cc (mmap_record::alloc_page_map): Don't call VirtualProtect
+       on maps created with MAP_NORESERVE.
+
+2006-07-12  Corinna Vinschen  <corinna@vinschen.de>
+
        * include/pthread.h: Define PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT and
        PTHREAD_PRIO_PROTECT only if _POSIX_THREAD_PRIO_INHERIT is defined.
 
index cee1a81..7ca176c 100644 (file)
@@ -574,7 +574,7 @@ mmap_record::alloc_page_map ()
 
   DWORD start_protect = gen_create_protect ();
   DWORD real_protect = gen_protect ();
-  if (real_protect != start_protect
+  if (real_protect != start_protect && !noreserve ()
       && !VirtualProtect (get_address (), get_len (),
                          real_protect, &start_protect))
     system_printf ("Warning: VirtualProtect (addr: %p, len: 0x%x, "