diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-07-24 13:48:12 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-10-09 17:34:38 -0300 |
commit | edcda4c08ac033f40a91cb4def2fd0fa35a760ca (patch) | |
tree | 6676392a91b54b7b57253e37edff6262a33a656e /csu | |
parent | 00fe3c6657161a96890067666760ea8cf22b791c (diff) | |
download | glibc-edcda4c08ac033f40a91cb4def2fd0fa35a760ca.tar.gz glibc-edcda4c08ac033f40a91cb4def2fd0fa35a760ca.tar.xz glibc-edcda4c08ac033f40a91cb4def2fd0fa35a760ca.zip |
mips: Do not malloc on getdents64 fallback
This patch changes how the fallback getdents64 implementation calls non-LFS getdents by replacing the scratch_buffer with static buffer plus a loop on getdents calls. This avoids the potential malloc call on scratch_buffer_set_array_size for large input buffer size at the cost of more getdents syscalls. It also adds a small optimization for older kernels, where the first ENOSYS failure for getdents64 disable subsequent calls. Check the dirent tests on a mips64-linux-gnu with getdents64 code disabled. * sysdeps/unix/sysv/linux/mips/mips64/getdents64.c (__getdents64): Add small optimization for older kernel to avoid issuing __NR_getdents64 on each call and replace scratch_buffer usage with a static allocated buffer. Reviewed-by: Florian Weimer <fweimer@redhat.com>
Diffstat (limited to 'csu')
0 files changed, 0 insertions, 0 deletions