diff mbox

[ndctl] ndctl: fallback to sysconf for PAGE_SIZE

Message ID 151823784326.20330.6389521335698598896.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State Accepted
Commit 54024470c152
Headers show

Commit Message

Dan Williams Feb. 10, 2018, 4:44 a.m. UTC
On ARM and PowerPC PAGE_SIZE is not defined. Fall back to sysconf().

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 ndctl/ndctl.h |    5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h
index eb5a9b387b3d..ebd2a41cce46 100644
--- a/ndctl/ndctl.h
+++ b/ndctl/ndctl.h
@@ -16,6 +16,7 @@ 
 #include <ccan/array_size/array_size.h>
 #include <linux/types.h>
 #include <sys/user.h>
+#include <unistd.h>
 
 struct nd_cmd_dimm_flags {
 	__u32 status;
@@ -210,9 +211,13 @@  enum nd_driver_flags {
 	ND_DRIVER_DAX_PMEM	  = 1 << ND_DEVICE_DAX_PMEM,
 };
 
+#ifdef PAGE_SIZE
 enum {
 	ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,
 };
+#else
+#define ND_MIN_NAMESPACE_SIZE ((unsigned) sysconf(_SC_PAGESIZE))
+#endif
 
 enum ars_masks {
 	ARS_STATUS_MASK = 0x0000FFFF,