summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2020-05-20 17:23:02 +0000
committercheloha <cheloha@cvs.openbsd.org>2020-05-20 17:23:02 +0000
commit03fbaf2c295d77e6e98056d55ed6566162eb31a1 (patch)
treedc56ad636d1c64106a057f6414dca4dd589cff6e /sys/kern
parent7cbaf2415d32d9423fe157f1f3c566bef61dbebf (diff)
clock_gettime(2): use nanoruntime(9) to get value for CLOCK_UPTIME
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_time.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
index 3e5c753c3b3..6be556ecf2a 100644
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_time.c,v 1.129 2020/05/17 13:21:21 visa Exp $ */
+/* $OpenBSD: kern_time.c,v 1.130 2020/05/20 17:23:01 cheloha Exp $ */
/* $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $ */
/*
@@ -108,7 +108,6 @@ settime(const struct timespec *ts)
int
clock_gettime(struct proc *p, clockid_t clock_id, struct timespec *tp)
{
- struct bintime bt;
struct proc *q;
int error = 0;
@@ -117,9 +116,7 @@ clock_gettime(struct proc *p, clockid_t clock_id, struct timespec *tp)
nanotime(tp);
break;
case CLOCK_UPTIME:
- binuptime(&bt);
- bintimesub(&bt, &naptime, &bt);
- BINTIME_TO_TIMESPEC(&bt, tp);
+ nanoruntime(tp);
break;
case CLOCK_MONOTONIC:
case CLOCK_BOOTTIME: