changeset 38521:3cd64e3590e8

utimecmp: Add support for native Windows. * lib/utimecmp.c (SYSCALL_RESOLUTION): Set to 100 on native Windows.
author Bruno Haible <bruno@clisp.org>
date Mon, 01 May 2017 11:52:56 +0200
parents 0f47931842b9
children c2d38142dbf0
files ChangeLog lib/utimecmp.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon May 01 11:50:08 2017 +0200
+++ b/ChangeLog	Mon May 01 11:52:56 2017 +0200
@@ -1,3 +1,8 @@
+2017-04-30  Bruno Haible  <bruno@clisp.org>
+
+	utimecmp: Add support for native Windows.
+	* lib/utimecmp.c (SYSCALL_RESOLUTION): Set to 100 on native Windows.
+
 2017-04-30  Bruno Haible  <bruno@clisp.org>
 
 	utimens: Add support for native Windows.
--- a/lib/utimecmp.c	Mon May 01 11:50:08 2017 +0200
+++ b/lib/utimecmp.c	Mon May 01 11:52:56 2017 +0200
@@ -45,6 +45,10 @@
    no greater than 1 billion.  */
 #if HAVE_UTIMENSAT
 enum { SYSCALL_RESOLUTION = 1 };
+#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* On native Windows, file times have 100 ns resolution. See
+   <https://msdn.microsoft.com/en-us/library/ms724284.aspx>  */
+enum { SYSCALL_RESOLUTION = 100 };
 #elif ((HAVE_FUTIMESAT || HAVE_WORKING_UTIMES)                  \
        && (defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC             \
            || defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC     \