From 73d3dcb9b2817f03cef543b2b939cfbe1257eade Mon Sep 17 00:00:00 2001 From: andre Date: Fri, 18 Nov 2005 16:51:13 +0000 Subject: Add CLOCK_UPTIME to clock_gettime(2) reporting the current uptime measured in SI seconds. Sponsored by: TCP/IP Optimization Fundraise 2005 --- sys/kern/kern_time.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/kern') diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c index ac838be..fc8f6c7 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 -- cgit v1.1