From ede173219541fd67db42376bb7979bcf2febcaf0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Thu, 29 Jan 2009 21:59:44 +0100 Subject: [PATCH] add configure check for Tru64 sub-second timestamp resolution --- source3/configure.in | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/source3/configure.in b/source3/configure.in index 87707a2f7f7c..3ae2c8c9d373 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1474,6 +1474,46 @@ if test x"$samba_cv_stat_hires_notimespec_n" = x"yes" ; then [whether struct stat has sub-second timestamps without struct timespec suffixed _n]) fi +dnl Tru64 has _micro_second_ resolution: +AC_CACHE_CHECK([whether struct stat has sub-second timestamps in st_uXtime], samba_cv_stat_hires_uxtime, + [ + AC_TRY_COMPILE( + [ +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif +#ifdef HAVE_SYS_STAT_H +#include +#endif + ], + [ + struct timespec t; + struct stat s = {0}; + t.tv_sec = s.st_mtime; + t.tv_nsec = s.st_umtime * 1000; + t.tv_sec = s.st_ctime; + t.tv_nsec = s.st_uctime * 1000; + t.tv_sec = s.st_atime; + t.tv_nsec = s.st_uatime * 1000; + ], + samba_cv_stat_hires_uxtime=yes, samba_cv_stat_hires_uxtime=no) + ]) + +if test x"$samba_cv_stat_hires_uxtime" = x"yes" ; then + AC_DEFINE(HAVE_STAT_ST_UMTIME, 1, [whether struct stat contains st_umtime]) + AC_DEFINE(HAVE_STAT_ST_UATIME, 1, [whether struct stat contains st_uatime]) + AC_DEFINE(HAVE_STAT_ST_UCTIME, 1, [whether struct stat contains st_uctime]) + AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1, + [whether struct stat has sub-second timestamps in st_uXtime]) +fi + AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birthtimespec, [ AC_TRY_COMPILE( -- 2.34.1