This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 1/5] mips: Do not malloc on getdents64 fallback
* Adhemerval Zanella:
> On 28/08/2019 11:42, Florian Weimer wrote:
>> * Adhemerval Zanella:
>>
>>> struct kernel_dirent
>>> + {
>>> + unsigned long d_ino;
>>> + unsigned long d_off;
>>> + unsigned short int d_reclen;
>>> + char d_name[1];
>>> + } kbuf[KBUF_SIZE / sizeof (struct kernel_dirent)];
>>
>> I think it's still not clear to me in which cases we actually need to
>> move the dirent entries in the buffer. My impression is that we just
>> need to move d_name by one byte because before, d_type was after the
>> name, and afterwards, it comes before the name. But the record
>> boundaries are unchanged.
>
> My understanding is the record boundary would be same as long the
> d_name fits on the alignment padding space minus the size of the
> d_type. Otherwise the dirent64 will need to be extended.
Hmm. The problem is mips64 n32, right? Where unsigned long is 32 bits?
Thanks,
Florian