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/unix/sysv/linux/dl-getcwd.c | 1 + 1 file changed, 1 insertion(+) create mode 100644 sysdeps/unix/sysv/linux/dl-getcwd.c (limited to 'sysdeps/unix/sysv/linux/dl-getcwd.c') diff --git a/sysdeps/unix/sysv/linux/dl-getcwd.c b/sysdeps/unix/sysv/linux/dl-getcwd.c new file mode 100644 index 0000000000..4bd5657f1e --- /dev/null +++ b/sysdeps/unix/sysv/linux/dl-getcwd.c @@ -0,0 +1 @@ +#include "getcwd.c" -- cgit v1.2.3