glibc/sysdeps/unix/sysv/linux/dl-getcwd.c
Ulrich Drepper 7fb90fb89b 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).
2011-05-08 08:37:19 -04:00

2 lines
20 B
C