Ludovic Courtès wrote: > On GNU/Hurd, ‘struct statfs’ is defined in <sys/statfs.h>. However, > fsusage.c ends up including only <sys/statvfs.h>, and thus, ‘struct > statfs’ and the ‘statfs’ function aren’t defined/declared, leading to: > > fsusage.c: In function 'get_fs_usage': > fsusage.c:222:17: error: storage size of 'fsd' isn't known > fsusage.c:224:3: warning: implicit declaration of function 'statfs' > [-Wimplicit-function-declaration] > > (Seen on <http://hydra.nixos.org/build/2751266>.) > > The fix appears to be to include <sys/statfs.h> when STAT_STATFS2_FRSIZE > is defined.
Hi Ludo, Thanks for the report and suggested fix. Can you easily see if this does the job? >From 3e26070ccd633da280ade87c8441da52fb957473 Mon Sep 17 00:00:00 2001 From: Jim Meyering <meyer...@redhat.com> Date: Mon, 2 Jul 2012 22:26:44 +0200 Subject: [PATCH] fsusage: avoid build failure on GNU/Hurd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/fsusage.c [STAT_STATFS2_FRSIZE]: Include <sys/statfs.h>. Report and suggested fix from Ludovic Courtès. --- ChangeLog | 6 ++++++ lib/fsusage.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a798eb..034c434 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2012-07-02 Jim Meyering <meyer...@redhat.com> + + fsusage: avoid build failure on GNU/Hurd + * lib/fsusage.c [STAT_STATFS2_FRSIZE]: Include <sys/statfs.h>. + Report and suggested fix from Ludovic Courtès. + 2012-06-28 Bruno Haible <br...@clisp.org> log10f: Fix possible configuration problem. diff --git a/lib/fsusage.c b/lib/fsusage.c index bca78cc..39dc57b 100644 --- a/lib/fsusage.c +++ b/lib/fsusage.c @@ -55,6 +55,10 @@ # include "full-read.h" #endif +#ifdef STAT_STATFS2_FRSIZE +# include <sys/statfs.h> +#endif + /* The results of open() in this file are not used with fchdir, therefore save some unnecessary work in fchdir.c. */ #undef open -- 1.7.11.1.104.ge7b44f1