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). --- dirent/rewinddir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dirent') diff --git a/dirent/rewinddir.c b/dirent/rewinddir.c index e78d316880..85009b6509 100644 --- a/dirent/rewinddir.c +++ b/dirent/rewinddir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1991, 1995, 1996, 1997, 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 @@ -29,6 +29,7 @@ rewinddir (dirp) __set_errno (ENOSYS); /* No way to indicate failure. */ } +libc_hidden_def (rewinddir) stub_warning (rewinddir) -- cgit v1.2.3