summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2009-01-29 22:59:00 +0100
committerJeremy Allison <jra@samba.org>2009-01-29 15:26:13 -0800
commitd177015a6d43fcc26a823e52b86850a82261ad4d (patch)
tree9bce049d5fc666cd69563e696b29dac67ef1e089 /source3
parentede173219541fd67db42376bb7979bcf2febcaf0 (diff)
downloadsamba-d177015a6d43fcc26a823e52b86850a82261ad4d.tar.gz
samba-d177015a6d43fcc26a823e52b86850a82261ad4d.tar.bz2
samba-d177015a6d43fcc26a823e52b86850a82261ad4d.zip
add Tru64 sub-second resolution timestamp support
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/time.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 682d96c7db..e2cfe687b2 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -409,6 +409,11 @@ struct timespec get_atimespec(const SMB_STRUCT_STAT *pst)
ret.tv_sec = pst->st_atime;
ret.tv_nsec = pst->st_atime_n;
return ret;
+#elif defined(HAVE_STAT_ST_UATIME)
+ struct timespec ret;
+ ret.tv_sec = pst->st_atime;
+ ret.tv_nsec = pst->st_uatime * 1000;
+ return ret;
#elif defined(HAVE_STAT_ST_ATIMESPEC)
return pst->st_atimespec;
#else
@@ -431,6 +436,9 @@ void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
#elif defined(HAVE_STAT_ST_ATIME_N)
pst->st_atime = ts.tv_sec;
pst->st_atime_n = ts.tv_nsec;
+#elif defined(HAVE_STAT_ST_UATIME)
+ pst->st_atime = ts.tv_sec;
+ pst->st_uatime = ts.tv_nsec / 1000;
#elif defined(HAVE_STAT_ST_ATIMESPEC)
pst->st_atimespec = ts;
#else
@@ -461,6 +469,11 @@ struct timespec get_mtimespec(const SMB_STRUCT_STAT *pst)
ret.tv_sec = pst->st_mtime;
ret.tv_nsec = pst->st_mtime_n;
return ret;
+#elif defined(HAVE_STAT_ST_UMTIME)
+ struct timespec ret;
+ ret.tv_sec = pst->st_mtime;
+ ret.tv_nsec = pst->st_umtime * 1000;
+ return ret;
#elif defined(HAVE_STAT_ST_MTIMESPEC)
return pst->st_mtimespec;
#else
@@ -483,6 +496,9 @@ void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
#elif defined(HAVE_STAT_ST_MTIME_N)
pst->st_mtime = ts.tv_sec;
pst->st_mtime_n = ts.tv_nsec;
+#elif defined(HAVE_STAT_ST_UMTIME)
+ pst->st_mtime = ts.tv_sec;
+ pst->st_umtime = ts.tv_nsec / 1000;
#elif defined(HAVE_STAT_ST_MTIMESPEC)
pst->st_mtimespec = ts;
#else
@@ -513,6 +529,11 @@ struct timespec get_ctimespec(const SMB_STRUCT_STAT *pst)
ret.tv_sec = pst->st_ctime;
ret.tv_nsec = pst->st_ctime_n;
return ret;
+#elif defined(HAVE_STAT_ST_UCTIME)
+ struct timespec ret;
+ ret.tv_sec = pst->st_ctime;
+ ret.tv_nsec = pst->st_uctime * 1000;
+ return ret;
#elif defined(HAVE_STAT_ST_CTIMESPEC)
return pst->st_ctimespec;
#else
@@ -535,6 +556,9 @@ void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
#elif defined(HAVE_STAT_ST_CTIME_N)
pst->st_ctime = ts.tv_sec;
pst->st_ctime_n = ts.tv_nsec;
+#elif defined(HAVE_STAT_ST_UCTIME)
+ pst->st_ctime = ts.tv_sec;
+ pst->st_uctime = ts.tv_nsec / 1000;
#elif defined(HAVE_STAT_ST_CTIMESPEC)
pst->st_ctimespec = ts;
#else