summaryrefslogtreecommitdiff
path: root/m4/getcwd-abort-bug.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-01-24 10:12:00 +0100
committerBruno Haible <bruno@clisp.org>2021-01-24 10:14:41 +0100
commit6bb37d981199eb9df92bd44cc57471b8f845a7b8 (patch)
tree4dcfd2ffd82898bc6c1007d3a3e783563d7c259c /m4/getcwd-abort-bug.m4
parent829ed1e388a5c12fc8e8c7dd7af846a0540ffd7c (diff)
downloadgnulib-6bb37d981199eb9df92bd44cc57471b8f845a7b8.tar.gz
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.
Diffstat (limited to 'm4/getcwd-abort-bug.m4')
-rw-r--r--m4/getcwd-abort-bug.m419
1 files changed, 9 insertions, 10 deletions
diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4
index 89d068996b..bd32de1b79 100644
--- a/m4/getcwd-abort-bug.m4
+++ b/m4/getcwd-abort-bug.m4
@@ -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
])
])