summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2013-10-06 01:27:49 +0000
committerguenther <guenther@openbsd.org>2013-10-06 01:27:49 +0000
commite206ca2e95145f116d06a0b130e6c30106e6c835 (patch)
treee879c5cfe966c130496cfc17873f412cc4532599 /lib/libc/sys
parentBack out POLLHUP change until a problem with xterm hanging on close (diff)
downloadwireguard-openbsd-e206ca2e95145f116d06a0b130e6c30106e6c835.tar.xz
wireguard-openbsd-e206ca2e95145f116d06a0b130e6c30106e6c835.zip
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 .