Commit 28053af0 authored by Evan Hunt's avatar Evan Hunt

[master] nanosecond-accurate file modification times

4361.	[cleanup]	Where supported, file modification times returned
			by isc_file_getmodtime() are now accurate to the
			nanosecond. [RT #41968]
parent 370c6e0a
4361. [cleanup] Where supported, file modification times returned
by isc_file_getmodtime() are now accurate to the
nanosecond. [RT #41968]
4360. [bug] Silence spurious 'bad key type' message when there is
a existing TSIG key. [RT #42195]
......
......@@ -730,6 +730,7 @@ IRS_PLATFORM_USEDECLSPEC
LWRES_PLATFORM_USEDECLSPEC
ISC_PLATFORM_USEDECLSPEC
ISC_PLATFORM_RLIMITTYPE
ISC_PLATFORM_HAVESTATNSEC
ISC_PLATFORM_HAVESYSUNH
LWRES_PLATFORM_QUADFORMAT
ISC_PLATFORM_QUADFORMAT
......@@ -19227,6 +19228,34 @@ $as_echo "#define NEED_OPTARG 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#
# Check for nanoseconds in file stats
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking st_mtim.tv_nsec" >&5
$as_echo_n "checking st_mtim.tv_nsec... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <sys/fcntl.h>
int
main ()
{
struct stat s; return(s.st_mtim.tv_nsec);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
#
# BSD/OS, and perhaps some others, don't define rlim_t.
#
......
......@@ -3533,6 +3533,17 @@ AC_TRY_COMPILE([
GEN_NEED_OPTARG="-DNEED_OPTARG=1"
AC_DEFINE(NEED_OPTARG, 1, [Defined if extern char *optarg is not declared.])])
#
# Check for nanoseconds in file stats
#
AC_MSG_CHECKING(st_mtim.tv_nsec)
AC_TRY_COMPILE([#include <sys/fcntl.h>],[struct stat s; return(s.st_mtim.tv_nsec);],
[AC_MSG_RESULT(yes)
ISC_PLATFORM_HAVESTATNSEC="#define ISC_PLATFORM_HAVESTATNSEC 1"],
[AC_MSG_RESULT(no)
ISC_PLATFORM_HAVESTATNSEC="#undef ISC_PLATFORM_HAVESTATNSEC"])
AC_SUBST(ISC_PLATFORM_HAVESTATNSEC)
#
# BSD/OS, and perhaps some others, don't define rlim_t.
#
......
......@@ -249,6 +249,11 @@
*/
@ISC_PLATFORM_KRB5HEADER@
/*
* Define if the system has nanosecond-level accuracy in file stats.
*/
@ISC_PLATFORM_HAVESTATNSEC@
/*
* Type used for resource limits.
*/
......
......@@ -151,11 +151,11 @@ isc_file_getmodtime(const char *file, isc_time_t *modtime) {
result = file_stats(file, &stats);
if (result == ISC_R_SUCCESS)
/*
* XXXDCL some operating systems provide nanoseconds, too,
* such as BSD/OS via st_mtimespec.
*/
#ifdef ISC_PLATFORM_HAVESTATNSEC
isc_time_set(modtime, stats.st_mtime, stats.st_mtim.tv_nsec);
#else
isc_time_set(modtime, stats.st_mtime, 0);
#endif
return (result);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment