glibc/sysdeps
Adhemerval Zanella edcda4c08a 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>
2019-10-09 17:34:38 -03:00
..
aarch64 Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
alpha Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
arm Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
csky Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
generic Fix small error in HP_TIMING_PRINT trailing null char setting 2019-09-17 17:50:11 +08:00
gnu Add TCP_TX_DELAY from Linux 5.3 to netinet/tcp.h. 2019-09-27 13:37:36 +00:00
hppa Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
htl Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
hurd Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
i386 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
ia64 Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
ieee754 Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
init_array Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
m68k Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
mach Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
microblaze Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
mips Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
nios2 Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
nptl nptl: Move pthread_attr_setschedparam implementation into libc 2019-10-07 20:00:38 +02:00
posix Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
powerpc [powerpc] No need to enter "Ignore Exceptions Mode" 2019-10-02 10:30:51 -05:00
pthread Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
riscv Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
s390 Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
sh Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
sparc sparc: Assume GOTDATA support in the toolchain 2019-10-09 19:15:33 +02:00
unix mips: Do not malloc on getdents64 fallback 2019-10-09 17:34:38 -03:00
wordsize-32 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wordsize-64 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
x86 Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
x86_64 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00