diff options
author | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2016-09-13 13:16:11 +0200 |
---|---|---|
committer | Vicențiu Ciorbaru <vicentiu@mariadb.org> | 2016-09-13 13:37:05 +0200 |
commit | 6e02d426d5f3970f4a92e2501f410468faa6ef2b (patch) | |
tree | 5d9b736fc6c0e12f4f2b2ef21e62ad8be6ff6d9d | |
parent | b34d7fba31c4b18f12d400c247a09bce0ca635be (diff) | |
download | mariadb-git-6e02d426d5f3970f4a92e2501f410468faa6ef2b.tar.gz |
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.
-rw-r--r-- | storage/tokudb/PerconaFT/portability/huge_page_detection.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/tokudb/PerconaFT/portability/huge_page_detection.cc b/storage/tokudb/PerconaFT/portability/huge_page_detection.cc index bc48e93937d..8e73c56a6c5 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) { |