summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2009-01-29 00:33:19 +0100
committerKarolin Seeger <kseeger@samba.org>2009-01-30 14:20:05 +0100
commit2c127c4636eec1e060b3cfd5876622e42e8eafdd (patch)
treec73ace4f052c612b8b2ece9c545e7f6d2a578847
parent23429e754a5583493380e63b0f19d24641bbefea (diff)
downloadsamba-2c127c4636eec1e060b3cfd5876622e42e8eafdd.tar.gz
add configure check for AIX style sub-second resolution support
(cherry picked from commit e0381d6a173dcf64910ac597a10a3f0fa59ffe43)
-rw-r--r--source/configure.in44
1 files changed, 42 insertions, 2 deletions
diff --git a/source/configure.in b/source/configure.in
index 72540e18a55..11fea8f9adb 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -1327,7 +1327,7 @@ if test x"$samba_cv_stat_hires" = x"yes" ; then
[whether struct stat has sub-second timestamps])
fi
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec], samba_cv_stat_hires_notimespec,
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed nsec], samba_cv_stat_hires_notimespec,
[
AC_TRY_COMPILE(
[
@@ -1363,7 +1363,47 @@ if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
AC_DEFINE(HAVE_STAT_ST_ATIMENSEC, 1, [whether struct stat contains st_atimensec])
AC_DEFINE(HAVE_STAT_ST_CTIMENSEC, 1, [whether struct stat contains st_ctimensec])
AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
- [whether struct stat has sub-second timestamps without struct timespec])
+ [whether struct stat has sub-second timestamps without struct timespec suffixed nsec])
+fi
+
+dnl AIX stype sub-second timestamps:
+AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed _n], samba_cv_stat_hires_notimespec_n,
+ [
+ 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_mtime;
+ t.tv_nsec = s.st_mtime_n;
+ t.tv_sec = s.st_ctime;
+ t.tv_nsec = s.st_ctime_n;
+ t.tv_sec = s.st_atime;
+ t.tv_nsec = s.st_atime_n;
+ ],
+ samba_cv_stat_hires_notimespec_n=yes, samba_cv_stat_hires_notimespec_n=no)
+ ])
+
+if test x"$samba_cv_stat_hires_notimespec_n" = x"yes" ; then
+ AC_DEFINE(HAVE_STAT_ST_MTIME_N, 1, [whether struct stat contains st_mtime_n])
+ AC_DEFINE(HAVE_STAT_ST_ATIME_N, 1, [whether struct stat contains st_atime_n])
+ AC_DEFINE(HAVE_STAT_ST_CTIME_N, 1, [whether struct stat contains st_ctime_n])
+ AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
+ [whether struct stat has sub-second timestamps without struct timespec suffixed _n])
fi
AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birthtimespec,