]> Savannah Git Hosting - gnulib.git/commitdiff
getcwd: Fix cross-compilation guess for musl libc.
authorBruno Haible <bruno@clisp.org>
Sun, 24 Jan 2021 09:12:00 +0000 (10:12 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 24 Jan 2021 09:14:41 +0000 (10:14 +0100)
* m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Guess no also on
musl libc.
* doc/posix-functions/getcwd.texi: Update platform info.

ChangeLog
doc/posix-functions/getcwd.texi
m4/getcwd-abort-bug.m4

index e451f3368071bcb390d37fdcd312c36189de60c4..12bb66a4eaf5e05573ce74d86c39754b43ec2ac4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-24  Bruno Haible  <bruno@clisp.org>
+
+       getcwd: Fix cross-compilation guess for musl libc.
+       * m4/getcwd-abort-bug.m4 (gl_FUNC_GETCWD_ABORT_BUG): Guess no also on
+       musl libc.
+       * doc/posix-functions/getcwd.texi: Update platform info.
+
 2021-01-24  Bruno Haible  <bruno@clisp.org>
 
        expm1l: Fix configure test result with GCC 10 on powerpc64le.
index 9ca0ae377ee63f179c7e0cfa7e52b7ad880af698..9a4cf1e8bdc8aab90eb0019ad058e8a6ef65e842 100644 (file)
@@ -38,7 +38,7 @@ Portability problems fixed by Gnulib module @code{getcwd}:
 @item
 This function does not handle long file names (greater than @code{PATH_MAX})
 correctly on some platforms:
-glibc on Linux 2.4.20, Mac OS X 10.13, FreeBSD 6.4, NetBSD 9.0, OpenBSD 4.9, AIX 7.1.
+glibc on Linux 2.4.20, musl libc 1.2.2/powerpc64le, Mac OS X 10.13, FreeBSD 6.4, NetBSD 9.0, OpenBSD 6.7, AIX 7.1.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 89d068996b4d1771d80d3fb201d6629e0b8006b6..bd32de1b79683b8b4e3bc0694195115c46220709 100644 (file)
@@ -1,4 +1,4 @@
-# serial 15
+# serial 16
 # Determine whether getcwd aborts when the length of the working directory
 # name is unusually large.  Any length between 4k and 16k trigger the bug
 # when using glibc-2.4.90-9 or older.
@@ -128,11 +128,12 @@ main ()
           ]])],
        [gl_cv_func_getcwd_succeeds_beyond_4k=yes],
        [dnl An abort will provoke an exit code of something like 134 (128 + 6).
-        dnl An exit code of 4 can also occur (in OpenBSD 6.7, NetBSD 5.1 for
-        dnl example): getcwd (NULL, 0) fails rather than returning a string
-        dnl longer than PATH_MAX.  This may be POSIX compliant (in some
-        dnl interpretations of POSIX).  But gnulib's getcwd module wants to
-        dnl provide a non-NULL value in this case.
+        dnl An exit code of 4 can also occur (for example in
+        dnl musl libc 1.2.2/powerpc64le, NetBSD 9.0, OpenBSD 6.7:
+        dnl getcwd (NULL, 0) fails rather than returning a string longer than
+        dnl PATH_MAX.  This may be POSIX compliant (in some interpretations of
+        dnl POSIX).  But gnulib's getcwd module wants to provide a non-NULL
+        dnl value in this case.
         ret=$?
         if test $ret -ge 128 || test $ret = 4; then
           gl_cv_func_getcwd_succeeds_beyond_4k=no
@@ -141,10 +142,8 @@ main ()
         fi
        ],
        [case "$host_os" in
-                   # Guess yes on musl systems.
-          *-musl*) gl_cv_func_getcwd_succeeds_beyond_4k="guessing yes" ;;
-                   # Guess no otherwise, even on glibc systems.
-          *)       gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
+             # Guess no otherwise, even on glibc systems and musl systems.
+          *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
         esac
        ])
     ])