aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-05-08 08:37:19 -0400
committerUlrich Drepper <drepper@gmail.com>2011-05-08 08:37:19 -0400
commit7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1 (patch)
treec9fb5b27f0c75b57cd3090e2f3c857feba542f41 /include
parent28377d1bf58625172a1734b92e835591d4d23a18 (diff)
downloadglibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.zip
glibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.tar.gz
glibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.tar.bz2
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).
Diffstat (limited to 'include')
-rw-r--r--include/dirent.h2
-rw-r--r--include/sys/stat.h2
2 files changed, 4 insertions, 0 deletions
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
diff --git a/include/sys/stat.h b/include/sys/stat.h
index 66898b1..e00df53 100644
--- a/include/sys/stat.h
+++ b/include/sys/stat.h
@@ -48,4 +48,6 @@ libc_hidden_proto (__fxstatat64)
#define fstat64(fd, buf) __fxstat64 (_STAT_VER, fd, buf)
#define fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
#define __fstat(fd, buf) __fxstat (_STAT_VER, fd, buf)
+#define __fstatat(dfd, fname, buf, flag) \
+ __fxstatat (_STAT_VER, dfd, fname, buf, flag)
#endif