[PATCH 3/4] Use LFS readdir in generic POSIX getcwd [BZ# 22899]

Florian Weimer fweimer@redhat.com
Thu Aug 27 09:58:00 GMT 2020


* Adhemerval Zanella via Libc-alpha:

> diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
> index 7d4b0001b3..170a889c51 100644
> --- a/sysdeps/unix/sysv/linux/readdir64.c
> +++ b/sysdeps/unix/sysv/linux/readdir64.c
> @@ -42,7 +42,11 @@ weak_alias (__readdir64, readdir)
>  /* The compat code expects the 'struct direct' with d_ino being a __ino_t
>     instead of __ino64_t.  */
>  # include <shlib-compat.h>
> +# if IS_IN(rtld)
> +weak_alias (__readdir64, readdir64)
> +# else
>  versioned_symbol (libc, __readdir64, readdir64, GLIBC_2_2);
> +# endif

I don't think we need the full getcwd in the dynamic loader.  We only
use the fallback code if the kernel getcwd fails.  But that code does
not produce a path that is usable for the dynamic loader because it
cannot be used in open calls (it's too long for that).

I think for rtld, we should build getcwd without the fallback, and then
the change above won't be needed.

Thanks,
Florian



More information about the Libc-alpha mailing list