public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH] fix up userspace for newer glibc
Date: Wed, 20 Jan 2010 15:42:35 -0600	[thread overview]
Message-ID: <4B5778CB.5090909@redhat.com> (raw)

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>
---

Index: btrfs-progs-0.19/btrfsck.c
===================================================================
--- btrfs-progs-0.19.orig/btrfsck.c
+++ btrfs-progs-0.19/btrfsck.c
@@ -21,6 +21,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
 #include "kerncompat.h"
 #include "ctree.h"
 #include "disk-io.h"
Index: btrfs-progs-0.19/mkfs.c
===================================================================
--- btrfs-progs-0.19.orig/mkfs.c
+++ btrfs-progs-0.19/mkfs.c
@@ -341,7 +341,7 @@ int main(int ac, char **av)
 	u64 alloc_start = 0;
 	u64 metadata_profile = BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_DUP;
 	u64 data_profile = BTRFS_BLOCK_GROUP_RAID0;
-	u32 leafsize = getpagesize();
+	u32 leafsize = sysconf(_SC_PAGESIZE);
 	u32 sectorsize = 4096;
 	u32 nodesize = leafsize;
 	u32 stripesize = 4096;
@@ -398,7 +398,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);


                 reply	other threads:[~2010-01-20 21:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B5778CB.5090909@redhat.com \
    --to=sandeen@redhat.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox