diff options
author | Jeremy Allison <jra@samba.org> | 2005-07-22 01:14:09 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:00:15 -0500 |
commit | d6973499de8d70662178e9b558a3f5d2c70f203d (patch) | |
tree | f08bb42653dd46284fdbe714646e09cb72bdd9f0 /source3/configure.in | |
parent | 58a3749e9c4393330c1c795b689ffb98c0aae381 (diff) | |
download | samba-d6973499de8d70662178e9b558a3f5d2c70f203d.tar.gz samba-d6973499de8d70662178e9b558a3f5d2c70f203d.tar.bz2 samba-d6973499de8d70662178e9b558a3f5d2c70f203d.zip |
r8695: Patch from James Peach for hires timestamps and efficient
notify code. Bugid #2285. The last commit by me on behalf
of James as he will be able to do his own now :-).
Jeremy.
(This used to be commit 524298b3f32f478e3750d805c5dc3b8fbe40d8d2)
Diffstat (limited to 'source3/configure.in')
-rw-r--r-- | source3/configure.in | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in index d11acd0267..e343a9f54f 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1196,6 +1196,57 @@ if test x$ac_cv_func_fstat64 = xno ; then fi fi +################################################# +# Check whether struct stat has timestamps with sub-second resolution. +# At least IRIX and Solaris have these. +# +# We check that +# all of st_mtim, st_atim and st_ctim exist +# all of the members are in fact of type struct timespec +# +# There is some conflicting standards weirdness about whether we should use +# "struct timespec" or "timespec_t". Linux doesn't have timespec_t, so we +# prefer struct timespec. + +AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_stat_hires, + [ + AC_TRY_COMPILE( + [ +#if TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else +# if HAVE_SYS_TIME_H +# include <sys/time.h> +# else +# include <time.h> +# endif +#endif +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif + ], + [ + struct timespec t; + struct stat s = {0}; + t.tv_sec = s.st_mtim.tv_sec; + t.tv_nsec = s.st_mtim.tv_nsec; + t.tv_sec = s.st_ctim.tv_sec; + t.tv_nsec = s.st_ctim.tv_nsec; + t.tv_sec = s.st_atim.tv_sec; + t.tv_nsec = s.st_atim.tv_nsec; + ], + samba_stat_hires=yes, samba_stat_hires=no) + ]) + +if test x"$samba_stat_hires" = x"yes" ; then + AC_DEFINE(HAVE_STAT_ST_MTIM, 1, [whether struct stat contains st_mtim]) + AC_DEFINE(HAVE_STAT_ST_ATIM, 1, [whether struct stat contains st_atim]) + AC_DEFINE(HAVE_STAT_ST_CTIM, 1, [whether struct stat contains st_ctim]) + AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1, + [whether struct stat has sub-second timestamps]) +fi + ##################################### # we might need the resolv library on some systems AC_CHECK_LIB(resolv, dn_expand) |