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). --- sysdeps/mach/hurd/rewinddir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sysdeps/mach') diff --git a/sysdeps/mach/hurd/rewinddir.c b/sysdeps/mach/hurd/rewinddir.c index 69564536c9..322844e639 100644 --- a/sysdeps/mach/hurd/rewinddir.c +++ b/sysdeps/mach/hurd/rewinddir.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1994, 1997 Free Software Foundation, Inc. +/* Copyright (C) 1994, 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 @@ -22,10 +22,10 @@ #include /* Rewind DIRP to the beginning of the directory. */ -/* XXX should be __rewinddir ? */ void rewinddir (dirp) DIR *dirp; { seekdir (dirp, (off_t) 0L); } +libc_hidden_def (rewinddir) -- cgit 1.4.1