From 6e02d426d5f3970f4a92e2501f410468faa6ef2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 13 Sep 2016 13:16:11 +0200 Subject: [PATCH] Fix compilation failure of TokuDB on BSD-like systems mincore is defined differently in BSD mincore(void *, size_t, char *) vs linux variant of: mincore(void *, size_t, unsigned char *). Account for this difference in TokuDB. --- storage/tokudb/PerconaFT/portability/huge_page_detection.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/storage/tokudb/PerconaFT/portability/huge_page_detection.cc b/storage/tokudb/PerconaFT/portability/huge_page_detection.cc index bc48e93937da4..8e73c56a6c549 100644 --- a/storage/tokudb/PerconaFT/portability/huge_page_detection.cc +++ b/storage/tokudb/PerconaFT/portability/huge_page_detection.cc @@ -90,7 +90,13 @@ static bool check_huge_pages_in_practice(void) const long pagesize = 4096; const long n_pages = TWO_MB/pagesize; +#ifdef __linux__ + // On linux mincore is defined as mincore(void *, size_t, unsigned char *) unsigned char vec[n_pages]; +#else + // On BSD (OS X included) it is defined as mincore(void *, size_t, char *) + char vec[n_pages]; +#endif { int r = mincore(second, TWO_MB, vec); if (r!=0 && errno==ENOMEM) {