summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--btrfsck.c2
-rw-r--r--mkfs.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/btrfsck.c b/btrfsck.c
index a8510085..6274ff76 100644
--- a/btrfsck.c
+++ b/btrfsck.c
@@ -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 --git a/mkfs.c b/mkfs.c
index 56c1d9bb..384f2c61 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1206,7 +1206,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;
@@ -1282,7 +1282,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))