Blob Blame History Raw
diff -up btrfs-progs-0.19/btrfsck.c.orig btrfs-progs-0.19/btrfsck.c
--- btrfs-progs-0.19/btrfsck.c.orig	2012-04-11 10:44:44.000000000 -0400
+++ btrfs-progs-0.19/btrfsck.c	2012-04-11 10:45:35.769767880 -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.19/mkfs.c.orig btrfs-progs-0.19/mkfs.c
--- btrfs-progs-0.19/mkfs.c.orig	2012-04-11 10:44:44.652047854 -0400
+++ btrfs-progs-0.19/mkfs.c	2012-04-11 10:46:03.727553072 -0400
@@ -1198,7 +1198,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;
@@ -1270,7 +1270,7 @@ int main(int ac, char **av)
 				print_usage();
 		}
 	}
-	sectorsize = max(sectorsize, (u32)getpagesize());
+	sectorsize = max(sectorsize, (u32)sysconf(_SC_PAGESIZE));
 	if (leafsize < sectorsize || (leafsize & (sectorsize - 1))) {
 		fprintf(stderr, "Illegal leafsize %u\n", leafsize);
 		exit(1);