aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_time.c
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2005-11-18 16:51:13 +0000
committerAndre Oppermann <andre@FreeBSD.org>2005-11-18 16:51:13 +0000
commit5eefd889493e99768ddd96e0c23322ef0058321e (patch)
tree258c66acab17953d8aabe5c97d75ef6ca12b92e9 /sys/kern/kern_time.c
parente8fbd4a86d0680d420873d7929857d04a0b5dfc1 (diff)
downloadsrc-5eefd889493e99768ddd96e0c23322ef0058321e.tar.gz
src-5eefd889493e99768ddd96e0c23322ef0058321e.zip
Add CLOCK_UPTIME to clock_gettime(2) reporting the current
uptime measured in SI seconds. Sponsored by: TCP/IP Optimization Fundraise 2005
Notes
Notes: svn path=/head/; revision=152585
Diffstat (limited to 'sys/kern/kern_time.c')
-rw-r--r--sys/kern/kern_time.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index ac838beb1e59..fc8f6c78899a 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -224,6 +224,7 @@ kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats)
TIMEVAL_TO_TIMESPEC(&user, ats);
break;
case CLOCK_MONOTONIC:
+ case CLOCK_UPTIME:
nanouptime(ats);
break;
default:
@@ -307,6 +308,7 @@ kern_clock_getres(struct thread *td, clockid_t clock_id, struct timespec *ts)
switch (clock_id) {
case CLOCK_REALTIME:
case CLOCK_MONOTONIC:
+ case CLOCK_UPTIME:
/*
* Round up the result of the division cheaply by adding 1.
* Rounding up is especially important if rounding down