aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-02-25 12:46:39 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-02-25 12:46:39 +0000
commit6b9a9ce6ba731f8f564163af2400b6559faf84d9 (patch)
tree1f9d89e0f7d8987dbae64a1a0ae6c34cbc677831
parentc8926a2b8d1910f5a09fc99fdbfa7291cda8246f (diff)
downloadnewlib-6b9a9ce6ba731f8f564163af2400b6559faf84d9.zip
newlib-6b9a9ce6ba731f8f564163af2400b6559faf84d9.tar.gz
newlib-6b9a9ce6ba731f8f564163af2400b6559faf84d9.tar.bz2
* mmap.cc (mmap64): Fix returned address by taking the granularity
into account.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/mmap.cc2
2 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 4409111..ee88fa4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-02-25 Corinna Vinschen <corinna@vinschen.de>
+
+ * mmap.cc (mmap64): Fix returned address by taking the granularity
+ into account.
+
2003-02-23 Pierre Humblet <pierre.humblet@ieee.org>
* syslog.cc (syslog): Do not unlock the file before closing it
diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc
index cb78e2f..6a30096 100644
--- a/winsup/cygwin/mmap.cc
+++ b/winsup/cygwin/mmap.cc
@@ -577,7 +577,7 @@ mmap64 (caddr_t addr, size_t len, int prot, int flags, int fd, __off64_t off)
/* Insert into the list */
mmap_record *rec = map_list->add_record (mmap_rec, off, len);
- caddr_t ret = rec->get_address () + off;
+ caddr_t ret = rec->get_address () + (off - gran_off);
syscall_printf ("%x = mmap() succeeded", ret);
ReleaseResourceLock (LOCK_MMAP_LIST, READ_LOCK | WRITE_LOCK, "mmap");
return ret;