[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 20:43:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

I don't want to flood the mailing lists, so let me merge Bruno's mail again.

On 07/17/2018 05:49 PM, Paul Eggert wrote:
On 07/16/2018 10:41 PM, Barath Aron wrote:
I guess it is more like a hack than a solution.

Quite true. We need a real solution here, not a hack. But that will need someone to look into it. If Threos is supposed to be like POSIX, it should use the POSIXish part of the relevant Gnulib code, not the BSDish part. So you could look into why the POSIXish part isn't working.

I prefer POSIX over BSD. The issue here, explicitly at mount lists, POSIX does not define an API for it, but BSD does. I choosed the BSD approach instead of the Linux's. Actually, it even worse, because getmntent(3) came from SunOS, according to the manpage. I like the BSD approach better, because the Linux solution wants file to be placed in the file system, but BSD is pure API that is not related to any magic file.

The only relevant functions in POSIX:
And this is not too much. :(

On 07/17/2018 07:09 PM, Bruno Haible wrote:
Barath Aron wrote:
... 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
If you want to minimize porting efforts in the long run, I would
suggest to implement the POSIX functions, rather than the BSD functions.
   * Lots of applications have been ported to run on Linux, and use
     the POSIX API to that effect.
   * POSIX is a standard that has even some dark corner-cases fledged
     out. Like you said here:
     > I cannot implement something in libc based on
     > presumption. That's why I'm looking for at least a manual page that
     > clearly defines ...
   * Test suites exist that you can use to validate your implementation
     (even if the implementation, as for Threos, is closed-source).


I absolutely agree, it is a goal to support as many POSIX functions as possible. The only issue is that POSIX, as far as I know, does not define any API to query the mount list with.

I think I conclude with this:
I implemented the BSD's getmntinfo() and getfsstat() functions according the manual pages that I found. Therefore, the original question turned into this: Does gnulib support BSD's getmntinfo()? Since it looks not, what can we do?
The struct fsstat still bothers me, but this will remain a mystery.


reply via email to

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