diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-05-08 08:37:19 -0400 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-05-08 08:37:19 -0400 |
commit | 7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1 (patch) | |
tree | c9fb5b27f0c75b57cd3090e2f3c857feba542f41 /sysdeps/unix/rewinddir.c | |
parent | 28377d1bf58625172a1734b92e835591d4d23a18 (diff) | |
download | glibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.tar glibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.tar.gz glibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.tar.bz2 glibc-7fb90fb89bbdf273ab7ab96517fe1b156cd7aee1.zip |
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 'sysdeps/unix/rewinddir.c')
-rw-r--r-- | sysdeps/unix/rewinddir.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/unix/rewinddir.c b/sysdeps/unix/rewinddir.c index 051e93595e..89b0e6d20d 100644 --- a/sysdeps/unix/rewinddir.c +++ b/sysdeps/unix/rewinddir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995-1998, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995-1998, 2005, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,3 +35,4 @@ rewinddir (dirp) dirp->size = 0; __libc_lock_unlock (dirp->lock); } +libc_hidden_def (rewinddir) |