diff options
| author | 2020-05-20 17:23:01 +0000 | |
|---|---|---|
| committer | 2020-05-20 17:23:01 +0000 | |
| commit | c0109e1697ad6ec1bdd9b1c8a0e7b7155c86f16b (patch) | |
| tree | 9da16046c79c24bdc38623399592e78afa53ea74 | |
| parent | timecounting: decide whether to advance offset within tc_windup() (diff) | |
| download | wireguard-openbsd-c0109e1697ad6ec1bdd9b1c8a0e7b7155c86f16b.tar.xz wireguard-openbsd-c0109e1697ad6ec1bdd9b1c8a0e7b7155c86f16b.zip | |
clock_gettime(2): use nanoruntime(9) to get value for CLOCK_UPTIME
| -rw-r--r-- | sys/kern/kern_time.c | 7 |
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: |
