From 895d15b81e7443a15210e61fb6083c21f7b00f4b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 17 Jan 2009 17:20:37 +0000 Subject: * mmap.cc (mmap64): Fix condition checking if anonymous mapping beyond EOF is required. --- winsup/cygwin/mmap.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/mmap.cc') 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) { -- cgit v1.2.3