[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configure issue: getfsstat(), 'struct statfs' and 'struct fsstat'

From: Barath Aron
Subject: Re: configure issue: getfsstat(), 'struct statfs' and 'struct fsstat'
Date: Tue, 17 Jul 2018 07:41:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0


Thank you all for the answers.

Let me merge Bruno's mail first:

On 07/17/2018 12:02 AM, Bruno Haible wrote:
The configuration of the gnulib 'mountlist' module (used by findutils
and coreutils, among others) is written in such a way that on OpenBSD
it uses the getmntinfo() function
which, according to this manual page, invokes getfsstat().

Why would you make it call getfsstat() directly?
I do not really need getfsstat(), but this was the first function that configure complained about. Personally, I like getmntinfo() much better, but I didn't know it until now. :)
That test is not meant to succeed on OpenBSD. As the comments
indicate, it's there for OSF/1 and Darwin.
I saw the comment, but I thought they use the same API shown in BSD, because their manual says "The getfsstat() function first appeared in 4.4BSD" and "The getmntinfo() function first appeared in 4.4BSD". Still, some reference to "struct fsstat" would be nice, since OSF/1 manpage talks about "struct statfs".
For Darwin (this is the best source I found, because https://developer.apple.com/documentation/Darwin/Reference/ManPages/ is dead):
Forgive my confusion, but I do not see "struct fsstat" anywhere.
It is maintained in gnulib, module 'mountlist'.
This is good news. :)

On 07/16/2018 11:11 PM, Paul Eggert wrote:
On 07/16/2018 01:05 PM, Bernhard Voelker wrote:
So, my questions are:
a) Why the configure use a different type name?

Comments suggest that this is what OSF/1 used.
I used the BSD manual pages, becase the best hit was identical to the BSD's API. It might was a mistake, but I prefer to implement something according to (as least) a consistent manual page.
b) If it is intentional, then where that type is defined?

Presumably in system include files.
This is problem to me. :(
Unfortunately, I cannot implement something in libc based on presumption. That's why I'm looking for at least a manual page that clearly defines struct fsstat. OSF/1 manpage isn't mention struct fsstat.

c) Is this branch of the configure still maintained, or it is abandoned?

OSF/1 is long dead.
I know. :)

  The related code that use this API is also still maintained?

Not as far as I know. However, it shouldn't be used on OpenBSD or FreeBSD, I expect. Someone (probably you :-) needs to figure out why it's being used. Sorry, I don't know what is normally used on OpenBSD and/or FreeBSD these days.

Well, I do not know it is used on BSDs or not. I try to compile findutils on an OS that partially (mostly?) supports POSIX, and implements widely used BSD functions. And when I saw the getfsstat() and now the getmntinfo() functions I put them into the libc, because the API looked way too simple, and they were implemented purely in libc. The intention was to support convenient API to query mount points. The OS is called Threos. You can find further info about this OS: https://threos.io

The cross-compiler used on x86_64 is basically a very simple wrapper around x86_64-pc-linux-gnu-gcc with a few flags set, i.e. -ffreestanding -nostdlib -nostdinc -I/path/to/include and some libraries. It also sets some other flags for linking. After cleaning it up, it will be published.

Side note: If I replace one line in the configure script, everything is fine. But I guess it is more like a hack than a solution. -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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]