[PATCH] y2038: Reorder placement of st_ino in struct __stat64_t64

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Oct 14 14:23:25 GMT 2020



On 14/10/2020 11:14, Lukasz Majewski wrote:
> Hi Adhemerval,
> 
>> On 14/10/2020 10:00, Lukasz Majewski wrote:
>>> In the installed struct stat{64} the __ino64_t st_ino member is
>>> placed in the end. This patch moves it to the same position as in
>>> the aforementioned, exported structures as it allows less #ifdefs
>>> for __USE_TIME_BITS64 support use case.  
>>
>> Why exactly this is required? Afaik this is glibc defined type not
>> currently only used internally and all member accesses are set
>> directly (no use or memcpy or offsetof).  Is this related to the
>> issue you saw on the arm environment? 
> 
> This is required to make the minimal changes to provide -D_TIME_SIZE=64
> support for {f}stat{at} as in:
> https://github.com/lmajewski/y2038_glibc/commit/26aa2ac07246682a505d85dac1c269689964b79b

But the idea it to decouple y2038 stat from the generic stat which
support non-LFS and make it support solely LFS. As Joseph has pointed
out, the __stat64_t64 should be architecture-independent and I think
it simplifies its definition to untie from struct_stat.h (which
has multiple definitions due historically each architecture 
to tie with the selected kernel ABI).

It leads to define the struct __stat64_t64 on its own header instead 
of trying to accommodate it on stat.h header.  The idea it to eventually
export struct_stat_time64.h as an installed header and make the
required redirections on stat.h header for -D_TIME_SIZE=64 (so
stat64 redirects to __stat_time64).


More information about the Libc-alpha mailing list