summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2019-03-23 21:39:37 +0100
committerBruno Haible <bruno@clisp.org>2019-03-23 21:40:21 +0100
commit407a19c087da37cf00af778fe403626312230943 (patch)
tree074221731ec71d59eef7fb628dab85729c92127f
parentb6f167d3194144f474f4e56ccb6591d80b029e99 (diff)
downloadgnulib-407a19c087da37cf00af778fe403626312230943.tar.gz
futimens: Document musl libc bug.
* doc/posix-functions/futimens.texi: Mention the bug. * m4/futimens.m4 (gl_FUNC_FUTIMENS): Require AC_CANONICAL_HOST. When cross-compiling, guess no on glibc and musl systems.
-rw-r--r--ChangeLog7
-rw-r--r--doc/posix-functions/futimens.texi2
-rw-r--r--m4/futimens.m422
3 files changed, 25 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b6524815fc..47f21d6b69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2019-03-23 Bruno Haible <bruno@clisp.org>
+ futimens: Document musl libc bug.
+ * doc/posix-functions/futimens.texi: Mention the bug.
+ * m4/futimens.m4 (gl_FUNC_FUTIMENS): Require AC_CANONICAL_HOST. When
+ cross-compiling, guess no on glibc and musl systems.
+
+2019-03-23 Bruno Haible <bruno@clisp.org>
+
Clarify that cross-compilation guesses are guesses.
* m4/chown.m4 (gl_FUNC_CHOWN_FOLLOWS_SYMLINK): When cross-compiling, add
prefix 'guessing ' to gl_cv_func_chown_follows_symlink.
diff --git a/doc/posix-functions/futimens.texi b/doc/posix-functions/futimens.texi
index 19fb84ea6b..1e1c76c177 100644
--- a/doc/posix-functions/futimens.texi
+++ b/doc/posix-functions/futimens.texi
@@ -29,7 +29,7 @@ Linux kernel 2.6.32, Solaris 11.1.
@item
Passing @code{AT_FDCWD} as the fd argument does not properly fail with
@code{EBADF} on some systems:
-glibc 2.11, Solaris 11.
+glibc 2.11, musl libc, Solaris 11.
@end itemize
Portability problems not fixed by Gnulib:
diff --git a/m4/futimens.m4 b/m4/futimens.m4
index 3cfa4a1988..b5f4be93b1 100644
--- a/m4/futimens.m4
+++ b/m4/futimens.m4
@@ -1,4 +1,4 @@
-# serial 7
+# serial 8
# See if we need to provide futimens replacement.
dnl Copyright (C) 2009-2019 Free Software Foundation, Inc.
@@ -11,6 +11,7 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_FUTIMENS],
[
AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([futimens])
if test $ac_cv_func_futimens = no; then
@@ -44,10 +45,21 @@ AC_DEFUN([gl_FUNC_FUTIMENS],
]])],
[gl_cv_func_futimens_works=yes],
[gl_cv_func_futimens_works=no],
- [gl_cv_func_futimens_works="guessing yes"])
+ [case "$host_os" in
+ # Guess no on glibc systems.
+ *-gnu* | gnu*) gl_cv_func_futimens_works="guessing no" ;;
+ # Guess no on musl systems.
+ *-musl*) gl_cv_func_futimens_works="guessing no" ;;
+ # Guess yes otherwise.
+ *) gl_cv_func_futimens_works="guessing yes" ;;
+ esac
+ ])
rm -f conftest.file])
- if test "$gl_cv_func_futimens_works" = no; then
- REPLACE_FUTIMENS=1
- fi
+ case "$gl_cv_func_futimens_works" in
+ *yes) ;;
+ *)
+ REPLACE_FUTIMENS=1
+ ;;
+ esac
fi
])