Patch attached.
From d3c62d48f87044d7607d81559c58ae06df5839af Mon Sep 17 00:00:00 2001
From: Ken Brown <kbr...@cornell.edu>
Date: Fri, 20 Dec 2024 12:17:34 -0500
Subject: [PATCH 2/5] Cygwin: mmap: remove is_mmapped_region()

The last use was removed in commit 29a126322783 ("Simplify stack
allocation code in child after fork").

Signed-off-by: Ken Brown <kbr...@cornell.edu>
---
 winsup/cygwin/local_includes/winsup.h |  1 -
 winsup/cygwin/mm/mmap.cc              | 34 ---------------------------
 2 files changed, 35 deletions(-)

diff --git a/winsup/cygwin/local_includes/winsup.h 
b/winsup/cygwin/local_includes/winsup.h
index 38313962d96c..6841d4a59fb4 100644
--- a/winsup/cygwin/local_includes/winsup.h
+++ b/winsup/cygwin/local_includes/winsup.h
@@ -239,7 +239,6 @@ enum mmap_region_status
     MMAP_NORESERVE_COMMITED
   };
 mmap_region_status mmap_is_attached_or_noreserve (void *addr, size_t len);
-bool is_mmapped_region (caddr_t start_addr, caddr_t end_address);
 
 extern inline bool flush_file_buffers (HANDLE h)
 {
diff --git a/winsup/cygwin/mm/mmap.cc b/winsup/cygwin/mm/mmap.cc
index acab85d19cf0..13e64c23256c 100644
--- a/winsup/cygwin/mm/mmap.cc
+++ b/winsup/cygwin/mm/mmap.cc
@@ -722,40 +722,6 @@ mmap_areas::del_list (mmap_list *ml)
   cfree (ml);
 }
 
-/* This function allows an external function to test if a given memory
-   region is part of an mmapped memory region. */
-bool
-is_mmapped_region (caddr_t start_addr, caddr_t end_address)
-{
-  size_t len = end_address - start_addr;
-
-  LIST_READ_LOCK ();
-  mmap_list *map_list = mmapped_areas.get_list_by_fd (-1, NULL);
-
-  if (!map_list)
-    {
-      LIST_READ_UNLOCK ();
-      return false;
-    }
-
-  mmap_record *rec;
-  caddr_t u_addr;
-  SIZE_T u_len;
-  bool contains;
-  bool ret = false;
-
-  LIST_FOREACH (rec, &map_list->recs, mr_next)
-    {
-      if (rec->match (start_addr, len, u_addr, u_len, contains))
-       {
-         ret = true;
-         break;
-       }
-    }
-  LIST_READ_UNLOCK ();
-  return ret;
-}
-
 /* This function is called from exception_handler when a segmentation
    violation has occurred.  It should also be called from all Cygwin
    functions that want to support passing noreserve (anonymous) mmap
-- 
2.45.1

Reply via email to