From a4a164c9e4c703c1f869de3a2e22793c66f0f74a Mon Sep 17 00:00:00 2001 From: Li Xi Date: Wed, 5 Mar 2014 09:27:39 +0800 Subject: [PATCH] LU-4199 libcfs: add wrapper of PAGE_SIZE PAGE_SIZE should not be used from userspace. It is not a constant on all architectures and new kernels do not export it to userspace anymore. Signed-off-by: Li Xi Signed-off-by: James Simmons Change-Id: Ib66534c31c7134833bf4768d3cc8bbc067b1bab4 Reviewed-on: http://review.whamcloud.com/8877 Tested-by: Jenkins Reviewed-by: Jinshan Xiong Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- libcfs/include/libcfs/libcfs.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libcfs/include/libcfs/libcfs.h b/libcfs/include/libcfs/libcfs.h index 72c2cc6..8a5ac8a 100644 --- a/libcfs/include/libcfs/libcfs.h +++ b/libcfs/include/libcfs/libcfs.h @@ -177,7 +177,12 @@ void lc_watchdog_delete(struct lc_watchdog *lcw); /* Dump a debug log */ void lc_watchdog_dumplog(pid_t pid, void *data); -#endif /* __KERNEL__ */ +#else /* !__KERNEL__ */ +#include +#ifndef PAGE_SIZE +#define PAGE_SIZE sysconf(_SC_PAGESIZE) +#endif +#endif /* !__KERNEL__ */ /* need both kernel and user-land acceptor */ #define LNET_ACCEPTOR_MIN_RESERVED_PORT 512 -- 1.8.3.1