1 #include <linux/time.h>
3 #include <linux/version.h>
5 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
7 /* "set_normalized_timespec" is defined but not exported in kernels
11 * set_normalized_timespec - set timespec sec and nsec parts and normalize
13 * @ts: pointer to timespec variable to be set
14 * @sec: seconds to set
15 * @nsec: nanoseconds to set
17 * Set seconds and nanoseconds field of a timespec variable and
18 * normalize to the timespec storage format
20 * Note: The tv_nsec part is always in the range of
21 * 0 <= tv_nsec < NSEC_PER_SEC
22 * For negative values only the tv_sec field is negative !
24 void set_normalized_timespec(struct timespec *ts,
25 time_t sec, long nsec)
27 while (nsec >= NSEC_PER_SEC) {
39 #endif /* linux kernel < 2.6.26 */