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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index 51e883df0fa5..ce321ac5c8f8 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -40,6 +40,8 @@ extern struct timezone sys_tz;
40#define NSEC_PER_SEC 1000000000L 40#define NSEC_PER_SEC 1000000000L
41#define FSEC_PER_SEC 1000000000000000L 41#define FSEC_PER_SEC 1000000000000000L
42 42
43#define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1)
44
43static inline int timespec_equal(const struct timespec *a, 45static inline int timespec_equal(const struct timespec *a,
44 const struct timespec *b) 46 const struct timespec *b)
45{ 47{
@@ -74,6 +76,8 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon,
74 const unsigned int min, const unsigned int sec); 76 const unsigned int min, const unsigned int sec);
75 77
76extern 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);
77 81
78/* 82/*
79 * sub = lhs - rhs, in normalized form 83 * sub = lhs - rhs, in normalized form
@@ -119,6 +123,7 @@ extern int do_setitimer(int which, struct itimerval *value,
119extern unsigned int alarm_setitimer(unsigned int seconds); 123extern unsigned int alarm_setitimer(unsigned int seconds);
120extern int do_getitimer(int which, struct itimerval *value); 124extern int do_getitimer(int which, struct itimerval *value);
121extern void getnstimeofday(struct timespec *tv); 125extern void getnstimeofday(struct timespec *tv);
126extern void getrawmonotonic(struct timespec *ts);
122extern void getboottime(struct timespec *ts); 127extern void getboottime(struct timespec *ts);
123extern void monotonic_to_bootbased(struct timespec *ts); 128extern void monotonic_to_bootbased(struct timespec *ts);
124 129
@@ -127,6 +132,9 @@ extern int timekeeping_valid_for_hres(void);
127extern void update_wall_time(void); 132extern void update_wall_time(void);
128extern void update_xtime_cache(u64 nsec); 133extern void update_xtime_cache(u64 nsec);
129 134
135struct tms;
136extern void do_sys_times(struct tms *);
137
130/** 138/**
131 * timespec_to_ns - Convert timespec to nanoseconds 139 * timespec_to_ns - Convert timespec to nanoseconds
132 * @ts: pointer to the timespec variable to be converted 140 * @ts: pointer to the timespec variable to be converted
@@ -216,6 +224,7 @@ struct itimerval {
216#define CLOCK_MONOTONIC 1 224#define CLOCK_MONOTONIC 1
217#define CLOCK_PROCESS_CPUTIME_ID 2 225#define CLOCK_PROCESS_CPUTIME_ID 2
218#define CLOCK_THREAD_CPUTIME_ID 3 226#define CLOCK_THREAD_CPUTIME_ID 3
227#define CLOCK_MONOTONIC_RAW 4
219 228
220/* 229/*
221 * The IDs of various hardware clocks: 230 * The IDs of various hardware clocks: