This is the mail archive of the
cygwin
mailing list for the Cygwin project.
[ATTN: PHP maintainer] Re: Fix for REAL_PAGE_SIZE in PHP
- From: Richard H Lee <ricardohenrylee at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Thu, 4 May 2017 15:39:34 +0100
- Subject: [ATTN: PHP maintainer] Re: Fix for REAL_PAGE_SIZE in PHP
- Authentication-results: sourceware.org; auth=none
- References: <528aeb1a-9a9d-0afd-7372-576e8c94ae81@gmail.com>
Here is my proposed patch for this bug:
diff --git a/Zend/zend_stream.c b/Zend/zend_stream.c
index 3fd7fa0..f5b9bea 100644
--- a/Zend/zend_stream.c
+++ b/Zend/zend_stream.c
@@ -30,7 +30,11 @@
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
+# ifdef __CYGWIN__
+# define REAL_PAGE_SIZE 4096
+# else
# define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
+# endif
# elif defined(_SC_PAGE_SIZE)
# define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
# endif
diff --git a/main/main.c b/main/main.c
index 01ed3a6..0909309 100644
--- a/main/main.c
+++ b/main/main.c
@@ -96,7 +96,11 @@
# if HAVE_UNISTD_H
# include <unistd.h>
# if defined(_SC_PAGESIZE)
+# ifdef __CYGWIN__
+# define REAL_PAGE_SIZE 4096
+# else
# define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
+# endif
# elif defined(_SC_PAGE_SIZE)
# define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
# endif
This definition needs to be fixed in two places as there are two
different places where a PHP source file can be mmap()ed, depending on
whether it is loaded using php-cli or loaded when php is run from a library.
On 02/05/2017 11:28, Richard H Lee wrote:
Should this fix go upstream to PHP or be submitted to the PHP
package within Cygwin?
I ask this as partially accessibly memory pages I guess are a quirk of
Cygwin. But then again programs ideally should not read past the end of
the EOF in the region the file is mmap()ed to.
Richard
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple