Supporting statvfs64 on 32-bit architectures, and long long?
Julien ÉLIE
julien at trigofacile.com
Mon Jan 22 20:02:37 UTC 2024
Hi Richard,
>> Yet, the Autoconf macro AC_SYS_LARGEFILE is used, and does not set
>> that flag. I would have expected it to.
>> Is someone aware of a particular trick to enable these 64-bit
>> functions on 32-bit architectures?
>
> Did you use ./configure --enable-largefiles? It defaults to no for some
> reason.
Oh, you're totally right. I thought it was enabled by default, and did not check that. The Debian package made it the default years ago (there once was an inn2-lfs package, now inn2) and I was somehow persuaded that it was the same in the stock upstream package.
And indeed, configuring the package with --enable-largefiles fixed the computation of free disk space.
... but not the computation of free inodes!
Incidentally, there was a comment in the code saying that "the free space in bytes would overflow an unsigned long. This should be safe until file systems larger than 4TB (which may not be much longer -- we should use long long instead if we have it)." :-)
So I switched the code to use long long when HAVE_LONG_LONG_INT is set by Autoconf, and inndf now works fine!
>> So I am a bit puzzled about how to support 32-bit architectures
>> nowadays, as just adding -D_FILE_OFFSET_BITS=64 fixes some things, but
>> not everything... In lack of a complete audit of the source code for
>> a proper fix, isn't INN to be considered broken or "use at your own
>> risk" on current 32-bit architectures? (but I do not know to what
>> extent it does not work)
>
> 32-bit x86 has increasingly poor support in Linux. Arm is still getting
> attention (Debian is trying to do a time_t 32->64 migration on 32-bit
> Arm platforms) but personally I think 32-bit server platforms are
> starting to look like retrocomputing now.
>
> Even the embedded platforms I use in my day job are 64-bit now!
Fair enough.
Thanks for your comment. Let's put our energy in other work than that
(except maybe for the time_t migration).
--
Julien ÉLIE
« Petite annonce : Artificier cherche femme canon. »
More information about the inn-workers
mailing list