aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2015-07-21 10:58:46 +0100
committerWill Deacon <will.deacon@arm.com>2015-07-22 16:57:34 +0100
commit4095fac878f618ae5e7384a1dc65ee34b6e05217 (patch)
tree1cecb53ab793d309040ee2471a304388051b744b
parentf9183c63e3b170a4a323a67fc7e06a83cf1b0dea (diff)
downloadkvmtool-4095fac878f618ae5e7384a1dc65ee34b6e05217.tar.gz
avoid redefining PAGE_SIZE
PAGE_SIZE may have been defined by the C libary (musl-libc does that). So avoid redefining it here unconditionally, instead only use our definition if none has been provided by the libc. Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--include/kvm/kvm.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/kvm/kvm.h b/include/kvm/kvm.h
index 754e0297..37155dbc 100644
--- a/include/kvm/kvm.h
+++ b/include/kvm/kvm.h
@@ -11,6 +11,7 @@
#include <time.h>
#include <signal.h>
#include <sys/prctl.h>
+#include <limits.h>
#define SIGKVMEXIT (SIGRTMIN + 0)
#define SIGKVMPAUSE (SIGRTMIN + 1)
@@ -19,7 +20,9 @@
#define HOME_DIR getenv("HOME")
#define KVM_BINARY_NAME "lkvm"
+#ifndef PAGE_SIZE
#define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
+#endif
#define DEFINE_KVM_EXT(ext) \
.name = #ext, \