From 895d15b81e7443a15210e61fb6083c21f7b00f4b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 17 Jan 2009 17:20:37 +0000 Subject: [PATCH] * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond EOF is required. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/mmap.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 537a19b05..50f25fee2 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-01-17 Corinna Vinschen + + * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond + EOF is required. + 2009-01-17 Corinna Vinschen * fhandler_proc.cc: Reorganize global proc content data into a new diff --git a/winsup/cygwin/mmap.cc b/winsup/cygwin/mmap.cc index 53e552368..30410692f 100644 --- a/winsup/cygwin/mmap.cc +++ b/winsup/cygwin/mmap.cc @@ -897,7 +897,9 @@ mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off) WOW64 does not support the AT_ROUND_TO_PAGE flag which is required to get this right. Too bad. */ if (!wincap.is_wow64 () - && ((len > fsiz && !autogrow (flags)) || len < pagesize)) + && ((len > fsiz && !autogrow (flags)) + || roundup2 (len, getsystempagesize ()) + < roundup2 (len, pagesize))) orig_len = len; if (len > fsiz) {