This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Linux: Add <sys/direntries.h>
* Adhemerval Zanella:
> 2. (mips64 only for kernel prior 3.10) __getdents calls malloc prior
> getdents syscall (due initial opendir buffers malloc will always
> be called);
> For 2. we can get back to a VLA and avoid malloc altogether, the default
> buffer used will trigger at most 32kb allocation and usage is pretty
> limited in a specific scenario.
I don't know the MIPS ABI. If it doesn't require alignment for the
char d_name[256] member, surely we can do the conversion inline, just
by calling memmove on the name? d_ino, d_off, d_reclen already have the
right size.
The present code already assumes that the d_type member is always
present at the end of the record, so there is always enough space, I
think.
Thanks,
Florian