+2024-09-16 Paul Eggert <eggert@cs.ucla.edu>
+
+ utimens: port to NetBSD-10.99.12/amd64
+ On this platform, <sys/time.h> declares utimens and lutimens and the
+ C library defines them, so we needn’t (and shouldn’t).
+ Problem reported privately by Thomas Klausner.
+ * lib/utimens.c (utimens) [HAVE_UTIMENS]: Don’t define.
+ (lutimens) [HAVE_LUTIMENS]: Don’t define.
+ * lib/utimens.h [HAVE_UTIMENS || HAVE_LUTIMENS]:
+ Include <sys/time.h>, for NetBSD’s declaration of utimens and lutimens.
+ (utimens) [HAVE_UTIMENS]: Don’t declare.
+ (lutimens) [HAVE_LUTIMENS]: Don’t declare.
+ * m4/utimens.m4 (gl_UTIMENS): Check for utimens, lutimens.
+
2024-09-16 Bruno Haible <bruno@clisp.org>
stdlib: Fix compilation error with Sun C++.
}
}
+#if !HAVE_UTIMENS
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively. */
int
{
return fdutimens (-1, file, timespec);
}
+#endif
+#if !HAVE_LUTIMENS
/* Set the access and modification timestamps of FILE to be
TIMESPEC[0] and TIMESPEC[1], respectively, without dereferencing
symlinks. Fail with ENOSYS if the platform does not support
errno = ENOSYS;
return -1;
}
+#endif
#include <time.h>
+#if HAVE_UTIMENS || HAVE_LUTIMENS
+# include <sys/time.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
int fdutimens (int, char const *, struct timespec const [2]);
+#if !HAVE_UTIMENS
int utimens (char const *, struct timespec const [2]);
+#endif
+#if !HAVE_LUTIMENS
int lutimens (char const *, struct timespec const [2]);
+#endif
#ifdef __cplusplus
}
# utimens.m4
-# serial 16
+# serial 17
dnl Copyright (C) 2003-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
gl_CHECK_FUNCS_ANDROID([lutimes], [[#include <sys/time.h>]])
gl_CHECK_FUNCS_ANDROID([futimens], [[#include <sys/stat.h>]])
gl_CHECK_FUNCS_ANDROID([utimensat], [[#include <sys/stat.h>]])
+ AC_CHECK_FUNCS_ONCE([utimens lutimens])
if test $ac_cv_func_futimens = no && test $ac_cv_func_futimesat = yes; then
dnl FreeBSD 8.0-rc2 mishandles futimesat(fd,NULL,time). It is not