]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix Linux getcwd for long paths
authorUlrich Drepper <drepper@gmail.com>
Sun, 8 May 2011 12:37:19 +0000 (08:37 -0400)
committerUlrich Drepper <drepper@gmail.com>
Sun, 8 May 2011 12:37:19 +0000 (08:37 -0400)
commit7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1
treec9fb5b27f0c75b57cd3090e2f3c857feba542f41
parent28377d1bf58625172a1734b92e835591d4d23a18
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
NEWS
dirent/rewinddir.c
include/dirent.h
include/sys/stat.h
sysdeps/mach/hurd/rewinddir.c
sysdeps/posix/getcwd.c
sysdeps/unix/rewinddir.c
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/dl-getcwd.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/getcwd.c