1 diff --git a/btrfsck.c b/btrfsck.c
2 index 63e44d1..1e040c4 100644
9 +#include <sys/types.h>
12 #include "kerncompat.h"
15 diff --git a/mkfs.c b/mkfs.c
16 index 2e99b95..638f4c2 100644
19 @@ -348,7 +348,7 @@ int main(int ac, char **av)
21 u64 metadata_profile = BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP;
22 u64 data_profile = BTRFS_BLOCK_GROUP_RAID0;
23 - u32 leafsize = getpagesize();
24 + u32 leafsize = sysconf(_SC_PAGESIZE);
25 u32 sectorsize = 4096;
26 u32 nodesize = leafsize;
27 u32 stripesize = 4096;
28 @@ -405,7 +405,7 @@ int main(int ac, char **av)
32 - sectorsize = max(sectorsize, (u32)getpagesize());
33 + sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
34 if (leafsize < sectorsize || (leafsize & (sectorsize - 1))) {
35 fprintf(stderr, "Illegal leafsize %u\n", leafsize);