3 # Copyright (C) 1998-1999, 2001, 2003-2004, 2006, 2009 Free Software
6 # This file is free software; the Free Software Foundation
7 # gives unlimited permission to copy and/or distribute it,
8 # with or without modifications, as long as this notice is preserved.
10 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
11 dnl then do case-insensitive s/utime/utimes/.
13 AC_DEFUN([gl_FUNC_UTIMES_NULL],
14 [AC_CACHE_CHECK([whether utimes accepts a null argument], [ac_cv_func_utimes_null],
15 [rm -f conftest.data; > conftest.data
17 /* In case stat has been defined to rpl_stat, undef it here. */
19 #include <sys/types.h>
25 return ! (stat ("conftest.data", &s) == 0
26 && utimes ("conftest.data", 0) == 0
27 && stat ("conftest.data", &t) == 0
28 && t.st_mtime >= s.st_mtime
29 && t.st_mtime - s.st_mtime < 120));
31 ac_cv_func_utimes_null=yes,
32 ac_cv_func_utimes_null=no,
33 ac_cv_func_utimes_null=no)
34 rm -f core core.* *.core])
36 if test $ac_cv_func_utimes_null = yes; then
37 AC_DEFINE([HAVE_UTIMES_NULL], [1],
38 [Define if utimes accepts a null argument])