summaryrefslogtreecommitdiffstats
path: root/source3/lib/time.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2009-02-05 16:39:28 +0100
committerJelmer Vernooij <jelmer@samba.org>2009-02-05 16:39:28 +0100
commit6d139ca4680abcbda5110f2f0886aa038ff62088 (patch)
tree7d61db40fb058bcbf08ccd8e0dadc365b819371b /source3/lib/time.c
parent4a9b3052caeb8bb144803b49dcfae82395172bc3 (diff)
parentafa960cbbcd609123d710c301e7a9a070c1fed70 (diff)
downloadsamba-6d139ca4680abcbda5110f2f0886aa038ff62088.tar.gz
samba-6d139ca4680abcbda5110f2f0886aa038ff62088.tar.xz
samba-6d139ca4680abcbda5110f2f0886aa038ff62088.zip
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Conflicts: librpc/ndr.pc.in
Diffstat (limited to 'source3/lib/time.c')
-rw-r--r--source3/lib/time.c58
1 files changed, 53 insertions, 5 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c
index 7dd0da8fa8..e2cfe687b2 100644
--- a/source3/lib/time.c
+++ b/source3/lib/time.c
@@ -404,6 +404,16 @@ 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_ATIME_N)
+ struct timespec ret;
+ 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
@@ -422,7 +432,13 @@ void set_atimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
pst->st_atim = ts;
#elif defined(HAVE_STAT_ST_ATIMENSEC)
pst->st_atime = ts.tv_sec;
- pst->st_atimensec = ts.tv_nsec
+ pst->st_atimensec = ts.tv_nsec;
+#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
@@ -448,6 +464,16 @@ 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_MTIME_N)
+ struct timespec ret;
+ 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
@@ -466,9 +492,15 @@ void set_mtimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
pst->st_mtim = 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;
+ pst->st_mtimensec = ts.tv_nsec;
+#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
#error CONFIGURE_ERROR_IN_DETECTING_TIMESPEC_IN_STAT
#endif
@@ -492,6 +524,16 @@ 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_CTIME_N)
+ struct timespec ret;
+ 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
@@ -510,7 +552,13 @@ void set_ctimespec(SMB_STRUCT_STAT *pst, struct timespec ts)
pst->st_ctim = ts;
#elif defined(HAVE_STAT_ST_CTIMENSEC)
pst->st_ctime = ts.tv_sec;
- pst->st_ctimensec = ts.tv_nsec
+ pst->st_ctimensec = ts.tv_nsec;
+#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