From: Ken Brown <kbrown@cornell.edu>
To: cygwin-devel <cygwin-developers@cygwin.com>
Subject: page_size vs allocation_granularity
Date: Tue, 21 Jul 2020 18:40:10 -0400 [thread overview]
Message-ID: <3ac8f341-1dbe-b407-de64-4a2d5c191e68@cornell.edu> (raw)
Hi Corinna,
I'm curious about the design decision that causes sysconf(_SC_PAGESIZE) to
return wincap.allocation_granularity() rather than wincap.page_size(). Changing
this would improve Linux compatibility, I think, but maybe it would have some
bad consequences that I'm not aware of.
I'm asking because in my recent fooling around with php, I noticed that Yaakov
had to apply the following Cygwin-specific patch to avoid a crash:
--- origsrc/php-7.1.13/Zend/zend_stream.c 2018-01-02 20:32:22.000000000 -0600
+++ src/php-7.1.13/Zend/zend_stream.c 2018-01-09 01:42:30.871472500 -0600
@@ -29,7 +29,9 @@
#if HAVE_MMAP
# if HAVE_UNISTD_H
# include <unistd.h>
-# if defined(_SC_PAGESIZE)
+# if defined(__CYGWIN__)
+# define REAL_PAGE_SIZE 4096
+# elif defined(_SC_PAGESIZE)
# define REAL_PAGE_SIZE sysconf(_SC_PAGESIZE);
# elif defined(_SC_PAGE_SIZE)
# define REAL_PAGE_SIZE sysconf(_SC_PAGE_SIZE);
Ken
next reply other threads:[~2020-07-21 22:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 22:40 Ken Brown [this message]
2020-07-22 8:33 ` Corinna Vinschen
2020-07-22 8:47 ` Corinna Vinschen
2020-07-22 11:36 ` Ken Brown
2020-07-22 16:42 ` Ken Brown
2020-07-22 18:35 ` Ken Brown
2020-07-22 18:48 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ac8f341-1dbe-b407-de64-4a2d5c191e68@cornell.edu \
--to=kbrown@cornell.edu \
--cc=cygwin-developers@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).