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). --- include/dirent.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/dirent.h') diff --git a/include/dirent.h b/include/dirent.h index 4db63a6..0f8f1cb 100644 --- a/include/dirent.h +++ b/include/dirent.h @@ -32,4 +32,6 @@ extern DIR *__alloc_dir (int fd, bool close_fd, int flags, const struct stat64 *statp) internal_function; +libc_hidden_proto (rewinddir) + #endif -- cgit v1.1