|
From: | Barath Aron |
Subject: | Fwd: Re: configure issue: getfsstat(), 'struct statfs' and 'struct fsstat' |
Date: | Mon, 16 Jul 2018 09:31:43 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
Hello, Can you help me with this issue? Original discussion is in the forwarded message. Freshly cloned findutils does the
same.
| #define PACKAGE_STRING "GNU findutils 4.6.0.180-e3b9" By applying the patch below [1], the configure succeeds. Aron [1] --- configure.orig 2018-07-11 13:35:40.011645265 +0200 +++ configure 2018-07-11 13:35:40.011645265 +0200 @@ -31703,7 +31703,7 @@ # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */ #endif " -ac_fn_c_check_member "$LINENO" "struct fsstat" "f_fstypename" "ac_cv_member_struct_fsstat_f_fstypename" "$getfsstat_includes +ac_fn_c_check_member "$LINENO" "struct statfs" "f_fstypename" "ac_cv_member_struct_fsstat_f_fstypename" "$getfsstat_includes " if test "x$ac_cv_member_struct_fsstat_f_fstypename" = xyes; then : -------- Forwarded Message --------
On 07/11/2018 02:00 PM, Barath Aron wrote: > Hello, > > I have a little issue around the detection of the getfsstat() function. > > According to multiple manuals from different BSD versions [1,2], the signature of the BSD's getfsstat() is this: > int getfsstat(struct statfs *buf, long bufsize, int mode); > > Note, it refers to 'struct statfs'. The statfs structure contains a field that will be interesting in the following [3,4]: > > struct statfs { > ... > char f_fstypename[MFSNAMELEN]; /* filesystem type name */ > ... > }; > > The configure script tries to detect the getfsstat() function but failes, because: > configure:31706: checking for struct fsstat.f_fstypename > configure:31706: /path/to/some-cross-gcc -c conftest.c >&5 > conftest.c: In function 'main': > conftest.c:473:22: error: storage size of 'ac_aggr' isn't known > static struct fsstat ac_aggr; > ^~~~~~~ > configure:31706: $? = 1 > configure: failed program was: > | /* confdefs.h */ > | #define PACKAGE_NAME "GNU findutils" > | #define PACKAGE_TARNAME "findutils" > | #define PACKAGE_VERSION "4.6.0" > ... > | int > | main () > | { > | static struct fsstat ac_aggr; > | if (ac_aggr.f_fstypename) > | return 0; > | ; > | return 0; > | } > > However, the used type in the failed program was 'struct fsstat'. By the definition of 'struct statfs' found in the BSD manuals, does have a field 'f_fstypename'. But the name is different. > > My goal is to compile the findutils by supplying the BSD's getfsstat() API to get mountlist. For now, I do not want to implement the Linux's <mntent.h> stuff, I like the BSD approach. > > So, my questions are: > a) Why the configure use a different type name? > b) If it is intentional, then where that type is defined? Unfortunately, I did not found anything. > c) Is this branch of the configure still maintained, or it is abandoned? The related code that use this API is also still maintained? > > Aron > > [1] https://man.openbsd.org/getfsstat.2 > [2] https://www.freebsd.org/cgi/man.cgi?query=getfsstat&sektion=2 > [3] https://man.openbsd.org/statfs.2 > [4] https://www.freebsd.org/cgi/man.cgi?query=statfs&sektion=2 This is a question for upstream gnulib. Before we move the discussion there and it is an already-fixed issue there, did you try to build findutils from latest Git as well? (4.6.0 is the latest release, but already quite aged...) Have a nice day, Berny |
[Prev in Thread] | Current Thread | [Next in Thread] |