mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-06 12:52:01 +00:00
btrfs-progs: Use sysconf instead of getpagesize
Rawhide is getting cranky with posix compliance, and a few things have stopped building. getpagesize() is now only available -with- __USE_XOPEN_EXTENDED or __USE_BSD, and NOT __USE_XOPEN2K. _GNU_SOURCE must define __USE_XOPEN2K because getpagesize() has gone away for mkfs. I gave up and used sysconf. Also, something used to pull in stat that no longer does, so things like S_ISREG weren't getting defined. The following fixes things for me. Signed-off-by: Eric Sandeen <sandeen@redhat.com>
This commit is contained in:
parent
cdbe16b309
commit
5cdc0913dd
@ -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"
|
||||
|
4
mkfs.c
4
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))
|
||||
|
Loading…
Reference in New Issue
Block a user