+2025-01-18 Collin Funk <collin.funk1@gmail.com>
+
+ renameatu: Work around a GNU/Hurd bug.
+ * m4/renameat.m4 (gl_FUNC_RENAMEAT): Check if renameat2 handles trailing
+ slashes.
+
2025-01-17 Paul Eggert <eggert@cs.ucla.edu>
alignasof: port to IBM XL C V16.1
# renameat.m4
-# serial 5
-dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
+# serial 6
+dnl Copyright (C) 2009-2025 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
if test $ac_cv_func_renameat2 = yes; then
AC_CACHE_CHECK([whether renameat2 works],
[gl_cv_func_renameat2_works],
- [AC_RUN_IFELSE(
+ [rm -rf conftest.a conftest.b
+ touch conftest.a
+ AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+ #include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
int main ()
{
+ int result = 0;
/* This test fails on Cygwin 3.4.6. */
if (renameat2 (AT_FDCWD, "conftest.c", AT_FDCWD, "conftest.c",
RENAME_NOREPLACE) == 0)
- return 1;
- return 0;
+ result |= 1;
+ /* This test fails on GNU/Hurd. */
+ if (renameat2 (AT_FDCWD, "conftest.a", AT_FDCWD, "conftest.b/", 0)
+ == 0)
+ result |= 2;
+ return result;
}
]])],
[gl_cv_func_renameat2_works=yes],
[case "$host_os" in
# Guess yes on Linux.
linux*) gl_cv_func_renameat2_works="guessing yes" ;;
+ # Guess no on GNU/Hurd.
+ gnu*) gl_cv_func_renameat2_works="guessing no" ;;
# Guess no on Cygwin.
cygwin*) gl_cv_func_renameat2_works="guessing no" ;;
# If we don't know, obey --enable-cross-guesses.
*) gl_cv_func_renameat2_works="$gl_cross_guess_normal" ;;
esac
])
+ rm -rf conftest.a conftest.b
])
case "$gl_cv_func_renameat2_works" in
*yes)