]>
git.proxmox.com Git - mirror_spl.git/blob - include/spl-time.h
5 * Structure returned by gettimeofday(2) system call,
6 * and used in other calls.
13 #include <linux/module.h>
14 #include <linux/time.h>
15 #include "spl-types.h"
17 extern unsigned long long monotonic_clock(void);
18 typedef struct timespec timestruc_t
; /* definition per SVr4 */
19 typedef longlong_t hrtime_t
;
21 #define TIME32_MAX INT32_MAX
22 #define TIME32_MIN INT32_MIN
26 #define MICROSEC 1000000
27 #define NANOSEC 1000000000
31 BUG_ON(HZ < 100 || HZ > MICROSEC); \
35 #define gethrestime(ts) getnstimeofday((ts))
37 static __inline__ hrtime_t
39 /* BUG_ON(cur_timer == timer_none); */
41 /* Solaris expects a long long here but monotonic_clock() returns an
42 * unsigned long long. Note that monotonic_clock() returns the number
43 * of nanoseconds passed since kernel initialization. Even for a signed
44 * long long this will not "go negative" for ~292 years.
46 return monotonic_clock();
49 static __inline__
time_t
63 #endif /* _SPL_TIME_H */