public inbox for cygwin-developers@cygwin.com
 help / color / mirror / Atom feed
* page_size vs allocation_granularity
@ 2020-07-21 22:40 Ken Brown
  2020-07-22  8:33 ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Brown @ 2020-07-21 22:40 UTC (permalink / raw)
  To: cygwin-devel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-22 18:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 22:40 page_size vs allocation_granularity Ken Brown
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

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).