From b90f1a4404ce7105acd424288af23bcc3f344c62 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 23 Nov 2004 09:44:17 +0000 Subject: tweak comment --- src/pwd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/pwd.c b/src/pwd.c index 96b301396..787f46582 100644 --- a/src/pwd.c +++ b/src/pwd.c @@ -247,7 +247,7 @@ find_dir_entry (struct stat *dot_sb, struct Path *path, size_t parent_height) /* Construct the full, absolute name of the current working directory and store it in *PATH. - The getcwd function does nearly the same task, but is typically + The getcwd function performs nearly the same task, but is typically unable to handle names longer than PATH_MAX. This function has no such limitation. However, this function *can* fail due to permission problems or a lack of memory, while Linux's getcwd @@ -260,6 +260,9 @@ find_dir_entry (struct stat *dot_sb, struct Path *path, size_t parent_height) used as a getcwd replacement. Unfortunately, considering all of the information the caller would require in order to produce good diagnostics, it doesn't seem worth the added complexity. + In any case, any getcwd replacement must *not* exceed the PATH_MAX + limitation. Otherwise, functions like `chdir' would fail with + ENAMETOOLONG. FIXME-maybe: if find_dir_entry fails due to permissions, try getcwd, in case the unreadable directory is close enough to the root that -- cgit v1.2.3-70-g09d2