Skip to content

Commit

Permalink
Fix compilation failure of TokuDB on BSD-like systems
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cvicentiu committed Sep 13, 2016
1 parent b34d7fb commit 6e02d42
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storage/tokudb/PerconaFT/portability/huge_page_detection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6e02d42

Please sign in to comment.