diff options
-rw-r--r-- | share/man/man9/microtime.9 | 9 | ||||
-rw-r--r-- | sys/kern/kern_tc.c | 11 | ||||
-rw-r--r-- | sys/sys/time.h | 3 |
3 files changed, 19 insertions, 4 deletions
diff --git a/share/man/man9/microtime.9 b/share/man/man9/microtime.9 index 36b783445e8..6bc71b21f3b 100644 --- a/share/man/man9/microtime.9 +++ b/share/man/man9/microtime.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: microtime.9,v 1.18 2019/01/19 01:53:44 cheloha Exp $ +.\" $OpenBSD: microtime.9,v 1.19 2019/10/22 20:19:41 cheloha Exp $ .\" $NetBSD: microtime.9,v 1.2 1999/03/16 00:40:47 garbled Exp $ .\" .\" Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: January 19 2019 $ +.Dd $Mdocdate: October 22 2019 $ .Dt MICROTIME 9 .Os .Sh NAME @@ -41,6 +41,7 @@ .Nm getnanotime , .Nm nanouptime , .Nm getnanouptime , +.Nm nanoboottime , .Nm bintime , .Nm binuptime , .Nm binboottime @@ -84,6 +85,10 @@ .Fa "struct timespec *tv" .Fc .Ft void +.Fo nanoboottime +.Fa "struct timespec *tv" +.Fc +.Ft void .Fo bintime .Fa "struct bintime *tv" .Fc diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 16cf6cdc605..d72f305a0bb 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_tc.c,v 1.48 2019/06/03 01:27:30 cheloha Exp $ */ +/* $OpenBSD: kern_tc.c,v 1.49 2019/10/22 20:19:41 cheloha Exp $ */ /* * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org> @@ -167,6 +167,15 @@ microboottime(struct timeval *tvp) } void +nanoboottime(struct timespec *tsp) +{ + struct bintime bt; + + binboottime(&bt); + BINTIME_TO_TIMESPEC(&bt, tsp); +} + +void binuptime(struct bintime *bt) { struct timehands *th; diff --git a/sys/sys/time.h b/sys/sys/time.h index 7e421478958..c034a87788f 100644 --- a/sys/sys/time.h +++ b/sys/sys/time.h @@ -1,4 +1,4 @@ -/* $OpenBSD: time.h,v 1.46 2019/08/03 22:53:45 cheloha Exp $ */ +/* $OpenBSD: time.h,v 1.47 2019/10/22 20:19:41 cheloha Exp $ */ /* $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ */ /* @@ -293,6 +293,7 @@ void getmicrouptime(struct timeval *); void binboottime(struct bintime *); void microboottime(struct timeval *); +void nanoboottime(struct timespec *); struct proc; int clock_gettime(struct proc *, clockid_t, struct timespec *); |