Due to the built-in tables, __NR_getdents64 is always defined,
although it may not be supported at run time.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
if (nbytes > INT_MAX)
nbytes = INT_MAX;
-#ifdef __NR_getdents64
static int getdents64_supported = true;
if (atomic_load_relaxed (&getdents64_supported))
{
atomic_store_relaxed (&getdents64_supported, false);
}
-#endif
/* Unfortunately getdents64 was only wire-up for MIPS n64 on Linux 3.10.
If the syscall is not available it need to fallback to the non-LFS one.