aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRical Jasan <ricaljasan@pacific.net>2018-02-16 08:47:20 -0800
committerDmitry V. Levin <ldv@altlinux.org>2018-02-19 20:39:17 +0000
commitb4108a361f05ee87122b86aa7d799e4512013588 (patch)
treece3e0063df139cd0f0bb892681047946f15f2261
parentaa02f2b2f53363fb4b8cfc508989fc161e28b6d9 (diff)
downloadglibc-b4108a361f05ee87122b86aa7d799e4512013588.tar
glibc-b4108a361f05ee87122b86aa7d799e4512013588.tar.gz
glibc-b4108a361f05ee87122b86aa7d799e4512013588.tar.bz2
glibc-b4108a361f05ee87122b86aa7d799e4512013588.zip
manual: Improve documentation of get_current_dir_name. [BZ #6889]
This is a minor rewording to clarify the behaviour of get_current_dir_name. Additionally, the @vindex is moved above the @deftypefun so that following links give a better result with regard to context. [BZ #6889] * manual/filesys.texi (get_current_dir_name): Clarify behaviour. (cherry picked from commit 7d15ef84f50a80cb170f8ce3457010f59e221cb8)
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--manual/filesys.texi17
3 files changed, 15 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 8eb6078485..727b2f92c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-19 Rical Jasan <ricaljasan@pacific.net>
+
+ [BZ #6889]
+ * manual/filesys.texi (get_current_dir_name): Clarify behaviour.
+
2018-02-16 Rical Jasan <ricaljasan@pacific.net>
* manual/platform.texi (__riscv_flush_icache): Fix @deftypefun
diff --git a/NEWS b/NEWS
index e40fa8d1df..5571c592bf 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Version 2.27.1
The following bugs are resolved with this release:
+ [6889] 'PWD' mentioned but not specified
[22638] sparc: static binaries are broken if glibc is built by gcc
configured with --enable-default-pie
[22735] Misleading typo in time.h source comment regarding CLOCKS_PER_SECOND
diff --git a/manual/filesys.texi b/manual/filesys.texi
index ca77996902..cc70a6b7ee 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -147,19 +147,20 @@ necessarily enough space to contain the directory name. That is why
this function is deprecated.
@end deftypefn
+@vindex PWD
@deftypefun {char *} get_current_dir_name (void)
@standards{GNU, unistd.h}
@safety{@prelim{}@mtsafe{@mtsenv{}}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{} @acsfd{}}}
@c Besides getcwd, which this function calls as a fallback, it calls
@c getenv, with the potential thread-safety issues that brings about.
-@vindex PWD
-This @code{get_current_dir_name} function is basically equivalent to
-@w{@code{getcwd (NULL, 0)}}. The only difference is that the value of
-the @code{PWD} variable is returned if this value is correct. This is a
-subtle difference which is visible if the path described by the
-@code{PWD} value is using one or more symbol links in which case the
-value returned by @code{getcwd} can resolve the symbol links and
-therefore yield a different result.
+The @code{get_current_dir_name} function is basically equivalent to
+@w{@code{getcwd (NULL, 0)}}, except the value of the @env{PWD}
+environment variable is first examined, and if it does in fact
+correspond to the current directory, that value is returned. This is
+a subtle difference which is visible if the path described by the
+value in @env{PWD} is using one or more symbolic links, in which case
+the value returned by @code{getcwd} would resolve the symbolic links
+and therefore yield a different result.
This function is a GNU extension.
@end deftypefun