summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--winsup/cygwin/common.din1
-rw-r--r--winsup/cygwin/include/cygwin/shm.h5
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/shm.cc4
4 files changed, 10 insertions, 3 deletions
diff --git a/winsup/cygwin/common.din b/winsup/cygwin/common.din
index fe714d874..7e72abe50 100644
--- a/winsup/cygwin/common.din
+++ b/winsup/cygwin/common.din
@@ -60,6 +60,7 @@ __freading NOSIGFE
__fsetlocking SIGFE
__fwritable NOSIGFE
__fwriting NOSIGFE
+__getpagesize = getpagesize SIGFE
__getreent NOSIGFE
__gnu_basename NOSIGFE
__infinity NOSIGFE
diff --git a/winsup/cygwin/include/cygwin/shm.h b/winsup/cygwin/include/cygwin/shm.h
index c58599379..5fbfb1152 100644
--- a/winsup/cygwin/include/cygwin/shm.h
+++ b/winsup/cygwin/include/cygwin/shm.h
@@ -13,7 +13,6 @@ details. */
#define _CYGWIN_SHM_H
#include <cygwin/ipc.h>
-#include <sys/cygwin.h>
#ifdef __cplusplus
extern "C"
@@ -24,7 +23,9 @@ extern "C"
*
* 64 Kb was hardcoded for x86. MS states this may change so the constant
* expression is replaced by a function call returning the correct value. */
-#define SHMLBA (cygwin_internal (CW_GET_SHMLBA))
+#define SHMLBA (__getpagesize ())
+/* internal alias of legacy getpagesize to avoid polluting global namespace */
+int __getpagesize (void);
/* Shared memory operation flags:
*/
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 4edb8dbc8..ee7c4ff6f 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -477,13 +477,14 @@ details. */
293: Convert utmpname/utmpxname to int.
294: Export clog10, clog10f.
295: Export POSIX ACL functions.
+ 296: Export __getpagesize.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull,
sigaltstack, sethostname. */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 295
+#define CYGWIN_VERSION_API_MINOR 296
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/shm.cc b/winsup/cygwin/shm.cc
index e209346f7..1d3200c36 100644
--- a/winsup/cygwin/shm.cc
+++ b/winsup/cygwin/shm.cc
@@ -21,6 +21,10 @@ details. */
#include "sync.h"
#include "ntdll.h"
+/* __getpagesize is only available from libcygwin.a */
+#undef SHMLBA
+#define SHMLBA (wincap.allocation_granularity ())
+
/*
* client_request_shm Constructors
*/