From 7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 8 May 2011 08:37:19 -0400 Subject: Fix Linux getcwd for long paths The getcwd syscall (so far?) can only handle path up to one page in size. There is no limit about directory hierarchy depth, though, and the POSIX getcwd is supposed to handle this. In that case fall back to the generic getcwd. Additionally, optimize the generic getcwd to use openat when possible to change the asymptotic performance from O(N^2) to O(n). --- ChangeLog | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 132f0d0649..488ce8f187 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2011-05-08 Ulrich Drepper + [BZ #12713] + * sysdeps/unix/sysv/linux/getcwd.c: If getcwd syscall report + ENAMETOOLONG use generic getcwd. + * sysdeps/posix/getcwd.c: Add support to use openat. + * sysdeps/unix/sysv/linux/Makefile [subdir=elf] (sysdep-rtld-routines): + Add dl-getcwd. + * sysdeps/unix/sysv/linux/dl-getcwd.c: New file. + * include/sys/stat.h: Define __fstatat macro. + * include/dirent.h: Add libc_hidden_proto for rewinddir. + * dirent/rewinddir.c: Add libc_hidden_def. + * sysdeps/mach/hurd/rewinddir.c: Likewise. + * sysdeps/unix/rewinddir.c: Likewise. + * include/dirent.h (__alloc_dir): Add flags parameter. * sysdeps/unix/fdopendir.c (__fdopendir): Pass flags to __alloc_dir. * sysdeps/unix/opendir.c (__opendir): Pass 0 in new parameter to -- cgit v1.2.3