BUG: https://bugzilla.samba.org/show_bug.cgi?id=7771
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
{
return (struct timespec){.tv_nsec = SAMBA_UTIME_OMIT};
}
+
+/**
+ * Like unix_timespec_to_nt_time() but without the special casing of tv_sec=0
+ * and -1. Also dealing with SAMBA_UTIME_OMIT.
+ **/
+NTTIME full_timespec_to_nt_time(const struct timespec *ts)
+{
+ uint64_t d;
+
+ if (ts->tv_sec == TIME_T_MAX) {
+ return 0x7fffffffffffffffLL;
+ }
+
+ if (is_omit_timespec(ts)) {
+ return 0;
+ }
+
+ d = ts->tv_sec;
+ d += TIME_FIXUP_CONSTANT_INT;
+ d *= 1000*1000*10;
+ /* d is now in 100ns units. */
+ d += (ts->tv_nsec / 100);
+
+ return d;
+}
*/
bool is_omit_timespec(const struct timespec *ts);
struct timespec make_omit_timespec(void);
+NTTIME full_timespec_to_nt_time(const struct timespec *ts);
#endif /* _SAMBA_TIME_H_ */