summaryrefslogtreecommitdiffstats
path: root/source3/lib/time.c
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-01-23 14:38:40 -0800
committerTim Prouty <tprouty@samba.org>2009-01-23 21:05:38 -0800
commit7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3 (patch)
treea4e742a5d71c0c0b1f01d51c8202908bcee340b6 /source3/lib/time.c
parentab2ee0711e128ac068e54a180fe2deb4b0c082be (diff)
downloadsamba-7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3.tar.gz
samba-7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3.tar.xz
samba-7bb3860f49cd8b09c2015f6646c07fe5ebaa0de3.zip
This change allows for the autoconfigre detection of sub-second time resolution in the FreeBSD stat structure
Diffstat (limited to 'source3/lib/time.c')
-rw-r--r--source3/lib/time.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index cae6b479b0..7dd0da8fa8 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -404,6 +404,8 @@ struct timespec get_atimespec(const SMB_STRUCT_STAT *pst)
ret.tv_sec = pst->st_atime;
ret.tv_nsec = pst->st_atimensec;
return ret;
+#elif defined(HAVE_STAT_ST_ATIMESPEC)
+ return pst->st_atimespec;
#else
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif
@@ -421,6 +423,8 @@ void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
#elif defined(HAVE_STAT_ST_ATIMENSEC)
pst->st_atime = ts.tv_sec;
pst->st_atimensec = ts.tv_nsec
+#elif defined(HAVE_STAT_ST_ATIMESPEC)
+ pst->st_atimespec = ts;
#else
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif
@@ -444,6 +448,8 @@ struct timespec get_mtimespec(const SMB_STRUCT_STAT *pst)
ret.tv_sec = pst->st_mtime;
ret.tv_nsec = pst->st_mtimensec;
return ret;
+#elif defined(HAVE_STAT_ST_MTIMESPEC)
+ return pst->st_mtimespec;
#else
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif
@@ -461,6 +467,8 @@ void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
#elif defined(HAVE_STAT_ST_MTIMENSEC)
pst->st_mtime = ts.tv_sec;
pst->st_mtimensec = ts.tv_nsec
+#elif defined(HAVE_STAT_ST_ATIMESPEC)
+ pst->st_atimespec = ts;
#else
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif
@@ -484,6 +492,8 @@ struct timespec get_ctimespec(const SMB_STRUCT_STAT *pst)
ret.tv_sec = pst->st_ctime;
ret.tv_nsec = pst->st_ctimensec;
return ret;
+#elif defined(HAVE_STAT_ST_CTIMESPEC)
+ return pst->st_ctimespec;
#else
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif
@@ -501,6 +511,8 @@ void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
#elif defined(HAVE_STAT_ST_CTIMENSEC)
pst->st_ctime = ts.tv_sec;
pst->st_ctimensec = ts.tv_nsec
+#elif defined(HAVE_STAT_ST_CTIMESPEC)
+ pst->st_ctimespec = ts;
#else
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif