namespace {
+ /**
+ * @brief <b>For internal use only</b>. Translates clock
+ * specification flags to kernel clock types.
+ *
+ * @param id Master clock id: \c mono, \c real, \c boot, or \c
+ * cpu.
+ * @param var Variant of clock if appropriate: \c raw, \c exact, \c
+ * process, or \c thread. Use \c dflt for the base
+ * variant.
+ *
+ * @return The clock id for using with kernel APIs.
+ */
static inline clockid_t
clockid_of_flags (const enum type::id id,
const enum type::variant var) NOEXCEPT
}
case type::boot: {
- if (var & type::exact) {
- cid = CLOCK_BOOTTIME;
- }
+ cid = CLOCK_BOOTTIME;
break;
}
return *this;
}
+ /*
+ * @note This operator is an up-assignment from a type containing less
+ * information than the structure assigned from. Since the
+ * operator can only be two valued we must normalize the remaining
+ * fields to the default clock. When assigning from non-default
+ * clocks, use the appropriate constructor and pass it the desired
+ * id and variant so as to assign the result.
+ */
Time &
Time::operator= (struct timespec ts) NOEXCEPT
{