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