Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2002-09-24 17:48:07 +0400
committerCorinna Vinschen <corinna@vinschen.de>2002-09-24 17:48:07 +0400
commit6b579509ea85b0e5dac7b389dae1776d3c5f38d0 (patch)
treeb98f7276c7c3c0188bcadfc3c96a354cadcc2f02
parent1878ede07212ff18029384dcc14a68b7adb74b3c (diff)
* mmap.cc (map_map): Add debug output.
(mmap64): Evaluate gran_len correctly even if offset isn't 0.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/mmap.cc3
2 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index d6ec54bc6..863fb0c7f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-24 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (map_map): Add debug output.
+ (mmap64): Evaluate gran_len correctly even if offset isn't 0.
+
2002-09-22 Christopher Faylor <cgf@redhat.com>
More GNUify non-GNU formatted functions calls throughout.
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index bb45ac8e6..68d993cdd 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -140,6 +140,7 @@ mmap_record::map_map (__off64_t off, DWORD len)
break;
}
+ debug_printf ("map_map (fd=%d, off=%D, len=%d)", fdesc_, off, len);
len = PAGE_CNT (len);
if (fdesc_ == -1 && !off)
{
@@ -468,7 +469,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
/* Map always in multipliers of `granularity'-sized chunks. */
__off64_t gran_off = off & ~(granularity - 1);
- DWORD gran_len = howmany (len, granularity) * granularity;
+ DWORD gran_len = howmany (off + len, granularity) * granularity - gran_off;
fhandler_base *fh;
caddr_t base = addr;