Commit 954e4653 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

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.
parent a95e384d
...@@ -90,7 +90,13 @@ static bool check_huge_pages_in_practice(void) ...@@ -90,7 +90,13 @@ static bool check_huge_pages_in_practice(void)
const long pagesize = 4096; const long pagesize = 4096;
const long n_pages = TWO_MB/pagesize; 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]; 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); int r = mincore(second, TWO_MB, vec);
if (r!=0 && errno==ENOMEM) { if (r!=0 && errno==ENOMEM) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment