On time64 and Large File Support
Paul Eggert
eggert@cs.ucla.edu
Sat Nov 12 18:33:40 GMT 2022
On 2022-11-11 20:20, Wookey wrote:
> It doesn't seem right to me that AC_SYS_LARGEFILE should imply
> AC_SYS_YEAR2038. What is the reasoning behind that?
First, in Autoconf git AC_SYS_LARGEFILE does not imply AC_SYS_YEAR2038.
The former is willing to fall back on 32-bit time_t if 64-bit is not
available. The latter errors out unless 64-bit time_t is available.
Second and to answer your question, the intent of AC_SYS_LARGEFILE has
always been, "I want open, stat, lseek, etc. to work on all files, and I
don't want them to fail with errno==EOVERFLOW simply because my integer
types are too narrow".
For this to work with glibc 2.34+ on x64 and arm GNU/Linux, time_t must
be 64 bits just as off_t, dev_t etc must be 64 bits; otherwise syscalls
like 'stat' stop working on some files. These failures can have security
implications. Many software developers, even in the security arena,
haven't thought through the implications of EOVERFLOW and their programs
do the wrong thing with EOVERFLOW.
More information about the Libc-alpha
mailing list