summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-10-06 01:27:51 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-10-06 01:27:51 +0000
commit8f27a4bba12b2ef9ab720af391064d39d1258362 (patch)
tree5ec500ca8d7f82bef55a8fb361313381065134fe /lib/libc/sys
parent214c9c0119954cbe8f50e81b4998d79a016914cd (diff)
Add CLOCK_UPTIME, a clock which measures time-running-not-suspended, so
that mlarkin@ can fix programs that report rates-over-uptime. ok kettenis@ manpage corrections jmc@ (which I've probably broken again)
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/clock_gettime.231
1 files changed, 28 insertions, 3 deletions
diff --git a/lib/libc/sys/clock_gettime.2 b/lib/libc/sys/clock_gettime.2
index e7b36d7121f..c5d52f0a16c 100644
--- a/lib/libc/sys/clock_gettime.2
+++ b/lib/libc/sys/clock_gettime.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: clock_gettime.2,v 1.21 2013/06/17 19:11:54 guenther Exp $
+.\" $OpenBSD: clock_gettime.2,v 1.22 2013/10/06 01:27:50 guenther Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -27,7 +27,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 17 2013 $
+.Dd $Mdocdate: October 6 2013 $
.Dt CLOCK_GETTIME 2
.Os
.Sh NAME
@@ -73,7 +73,13 @@ time that increments when the CPU is running in user or kernel mode
on behalf of the calling thread
.It Dv CLOCK_MONOTONIC
time that increments as a wall clock should but whose absolute value
-is meaningless and cannot jump, providing accurate interval measurement
+is meaningless and cannot jump,
+providing accurate realtime interval measurement,
+even across suspend and resume
+.It Dv CLOCK_UPTIME
+time whose absolute value is the time the system has been running
+and not suspended,
+providing accurate uptime measurement, both absolute and interval
.El
.Pp
The structure pointed to by
@@ -153,3 +159,22 @@ and
.Fn clock_settime
functions conform to
.St -p1003.1-2008 .
+.Pp
+The
+.Dv CLOCK_UPTIME
+clock is an extension to that.
+.Sh HISTORY
+The
+.Dv CLOCK_PROCESS_CPUTIME_ID
+and
+.Dv CLOCK_THREAD_CPUTIME_ID
+clocks appeared in
+.Ox 5.4 .
+The
+.Dv CLOCK_UPTIME
+clock first appeared in
+.Fx 7.0
+and was added to
+.Ox
+in
+.Ox 5.5 .