diff -up btrfs-progs-0.20.rc1.20121017git91d9eec/btrfsck.c.patch2 btrfs-progs-0.20.rc1.20121017git91d9eec/btrfsck.c
--- btrfs-progs-0.20.rc1.20121017git91d9eec/btrfsck.c.patch2 2012-10-04 20:35:31.000000000 -0400
+++ btrfs-progs-0.20.rc1.20121017git91d9eec/btrfsck.c 2012-10-17 13:45:30.172638798 -0400
@@ -22,7 +22,9 @@
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/types.h>
#include <sys/stat.h>
+#include <unistd.h>
#include <getopt.h>
#include "kerncompat.h"
#include "ctree.h"
diff -up btrfs-progs-0.20.rc1.20121017git91d9eec/mkfs.c.patch2 btrfs-progs-0.20.rc1.20121017git91d9eec/mkfs.c
--- btrfs-progs-0.20.rc1.20121017git91d9eec/mkfs.c.patch2 2012-10-17 13:45:30.167638835 -0400
+++ btrfs-progs-0.20.rc1.20121017git91d9eec/mkfs.c 2012-10-17 13:46:41.444084426 -0400
@@ -1228,7 +1228,7 @@ int main(int ac, char **av)
u64 alloc_start = 0;
u64 metadata_profile = 0;
u64 data_profile = 0;
- u32 leafsize = getpagesize();
+ u32 leafsize = sysconf(_SC_PAGESIZE);
u32 sectorsize = 4096;
u32 nodesize = leafsize;
u32 stripesize = 4096;
@@ -1304,7 +1304,7 @@ int main(int ac, char **av)
print_usage();
}
}
- sectorsize = max(sectorsize, (u32)getpagesize());
+ sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
if (check_leaf_or_node_size(leafsize, sectorsize))
exit(1);
if (check_leaf_or_node_size(nodesize, sectorsize))