summaryrefslogtreecommitdiff
path: root/winsup/cygwin/mmap.cc
diff options
context:
space:
mode:
authorscottc <scottc>2002-06-28 18:15:45 +0000
committerscottc <scottc>2002-06-28 18:15:45 +0000
commit479d671a369ffaeff4abedf03e6d6358eedb7199 (patch)
treee19922bccca4883cfc59e8ffc8f72d189ec4098e /winsup/cygwin/mmap.cc
parent66d5b1a5cd646d6c9aa32e1486893e29a921c3cc (diff)
downloadgdb-479d671a369ffaeff4abedf03e6d6358eedb7199.tar.gz
Merged changes from HEAD
Diffstat (limited to 'winsup/cygwin/mmap.cc')
-rw-r--r--winsup/cygwin/mmap.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index c89cf4c7b71..d1bda79d841 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -23,10 +23,10 @@ details. */
#include "pinfo.h"
#include "sys/cygwin.h"
-#define PAGE_CNT(bytes) howmany(bytes,getpagesize())
+#define PAGE_CNT(bytes) howmany((bytes),getpagesize())
#define PGBITS (sizeof(DWORD)*8)
-#define MAPSIZE(pages) howmany(pages,PGBITS)
+#define MAPSIZE(pages) howmany((pages),PGBITS)
#define MAP_SET(n) (map_map_[(n)/PGBITS] |= (1L << ((n) % PGBITS)))
#define MAP_CLR(n) (map_map_[(n)/PGBITS] &= ~(1L << ((n) % PGBITS)))
@@ -315,7 +315,8 @@ list::match (__off64_t off, DWORD len)
{
for (int i = 0; i < nrecs; ++i)
if (off >= recs[i].get_offset ()
- && off + len <= recs[i].get_offset () + recs[i].get_size ())
+ && off + len <= recs[i].get_offset ()
+ + (PAGE_CNT (recs[i].get_size ()) * getpagesize ()))
return recs + i;
}
return NULL;
@@ -327,7 +328,8 @@ list::match (caddr_t addr, DWORD len, __off32_t start)
{
for (int i = start + 1; i < nrecs; ++i)
if (addr >= recs[i].get_address ()
- && addr + len <= recs[i].get_address () + recs[i].get_size ())
+ && addr + len <= recs[i].get_address ()
+ + (PAGE_CNT (recs[i].get_size ()) * getpagesize ()))
return i;
return -1;
}