aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/time.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/time.h')
-rw-r--r--include/linux/time.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index e15206a7e82e..ce321ac5c8f8 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -29,6 +29,8 @@ struct timezone {
29 29
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32extern struct timezone sys_tz;
33
32/* Parameters used to convert the timespec values: */ 34/* Parameters used to convert the timespec values: */
33#define MSEC_PER_SEC 1000L 35#define MSEC_PER_SEC 1000L
34#define USEC_PER_MSEC 1000L 36#define USEC_PER_MSEC 1000L
@@ -38,6 +40,8 @@ struct timezone {
38#define NSEC_PER_SEC 1000000000L 40#define NSEC_PER_SEC 1000000000L
39#define FSEC_PER_SEC 1000000000000000L 41#define FSEC_PER_SEC 1000000000000000L
40 42
43#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
44
41static inline int timespec_equal(const struct timespec *a, 45static inline int timespec_equal(const struct timespec *a,
42 const struct timespec *b) 46 const struct timespec *b)
43{ 47{
@@ -72,6 +76,8 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon,
72 const unsigned int min, const unsigned int sec); 76 const unsigned int min, const unsigned int sec);
73 77
74extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); 78extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
79extern struct timespec timespec_add_safe(const struct timespec lhs,
80 const struct timespec rhs);
75 81
76/* 82/*
77 * sub = lhs - rhs, in normalized form 83 * sub = lhs - rhs, in normalized form
@@ -117,6 +123,7 @@ extern int do_setitimer(int which, struct itimerval *value,
117extern unsigned int alarm_setitimer(unsigned int seconds); 123extern unsigned int alarm_setitimer(unsigned int seconds);
118extern int do_getitimer(int which, struct itimerval *value); 124extern int do_getitimer(int which, struct itimerval *value);
119extern void getnstimeofday(struct timespec *tv); 125extern void getnstimeofday(struct timespec *tv);
126extern void getrawmonotonic(struct timespec *ts);
120extern void getboottime(struct timespec *ts); 127extern void getboottime(struct timespec *ts);
121extern void monotonic_to_bootbased(struct timespec *ts); 128extern void monotonic_to_bootbased(struct timespec *ts);
122 129
@@ -125,6 +132,9 @@ extern int timekeeping_valid_for_hres(void);
125extern void update_wall_time(void); 132extern void update_wall_time(void);
126extern void update_xtime_cache(u64 nsec); 133extern void update_xtime_cache(u64 nsec);
127 134
135struct tms;
136extern void do_sys_times(struct tms *);
137
128/** 138/**
129 * timespec_to_ns - Convert timespec to nanoseconds 139 * timespec_to_ns - Convert timespec to nanoseconds
130 * @ts: pointer to the timespec variable to be converted 140 * @ts: pointer to the timespec variable to be converted
@@ -214,6 +224,7 @@ struct itimerval {
214#define CLOCK_MONOTONIC 1 224#define CLOCK_MONOTONIC 1
215#define CLOCK_PROCESS_CPUTIME_ID 2 225#define CLOCK_PROCESS_CPUTIME_ID 2
216#define CLOCK_THREAD_CPUTIME_ID 3 226#define CLOCK_THREAD_CPUTIME_ID 3
227#define CLOCK_MONOTONIC_RAW 4
217 228
218/* 229/*
219 * The IDs of various hardware clocks: 230 * The IDs of various hardware clocks: