aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatt Helsley <matthltc@us.ibm.com>2005-12-12 03:37:09 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-12 11:57:42 -0500
commit64123fd42c7a1e4ebf6acd2399c98caddc7e0c26 (patch)
treed6b1794fa33287d145a44ab55bc2e2ef65ebf248 /include
parent894ec8707ced240b96dc45944790fb35d9a6b03c (diff)
[PATCH] Add getnstimestamp function
There are several functions that might seem appropriate for a timestamp: get_cycles() current_kernel_time() do_gettimeofday() <read jiffies/jiffies_64> Each has problems with combinations of SMP-safety, low resolution, and monotonicity. This patch adds a new function that returns a monotonic SMP-safe timestamp with nanosecond resolution where available. Changes: Split timestamp into separate patch Moved to kernel/time.c Renamed to getnstimestamp Fixed unintended-pointer-arithmetic bug Signed-off-by: Matt Helsley <matthltc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/time.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index bfbe92d0767c..797ccd813bb0 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -95,6 +95,7 @@ struct itimerval;
95extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); 95extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue);
96extern int do_getitimer(int which, struct itimerval *value); 96extern int do_getitimer(int which, struct itimerval *value);
97extern void getnstimeofday (struct timespec *tv); 97extern void getnstimeofday (struct timespec *tv);
98extern void getnstimestamp(struct timespec *ts);
98 99
99extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 100extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
100 101