summaryrefslogtreecommitdiffstats
path: root/share/man/man3
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2019-05-10 19:14:12 +0000
committercheloha <cheloha@openbsd.org>2019-05-10 19:14:12 +0000
commit20501fcc949d1489d8d0d3c2b28aa5061f2bea52 (patch)
tree7cb4c3d7fbcdf6741ed25f61a25c12bde79d0b5d /share/man/man3
parentFor PermitOpen violations add the remote host and port to (diff)
downloadwireguard-openbsd-20501fcc949d1489d8d0d3c2b28aa5061f2bea52.tar.xz
wireguard-openbsd-20501fcc949d1489d8d0d3c2b28aa5061f2bea52.zip
Document TIMEVAL_TO_TIMESPEC() and TIMESPEC_TO_TIMEVAL().
With input from schwarze@. "read ok" jmc@, "yep" deraadt@, ok schwarze@
Diffstat (limited to 'share/man/man3')
-rw-r--r--share/man/man3/timeradd.335
1 files changed, 32 insertions, 3 deletions
diff --git a/share/man/man3/timeradd.3 b/share/man/man3/timeradd.3
index 1690c4604ae..d89bac1176a 100644
--- a/share/man/man3/timeradd.3
+++ b/share/man/man3/timeradd.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: timeradd.3,v 1.2 2019/02/07 17:09:28 schwarze Exp $
+.\" $OpenBSD: timeradd.3,v 1.3 2019/05/10 19:14:12 cheloha Exp $
.\" $NetBSD: getitimer.2,v 1.6 1995/10/12 15:40:54 jtc Exp $
.\"
.\" Copyright (c) 1983, 1991, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)getitimer.2 8.2 (Berkeley) 12/11/93
.\"
-.Dd $Mdocdate: February 7 2019 $
+.Dd $Mdocdate: May 10 2019 $
.Dt TIMERADD 3
.Os
.Sh NAME
@@ -45,7 +45,9 @@
.Nm timespecisvalid ,
.Nm timespeccmp ,
.Nm timespecsub ,
-.Nm timespecadd
+.Nm timespecadd ,
+.Nm TIMEVAL_TO_TIMESPEC ,
+.Nm TIMESPEC_TO_TIMEVAL
.Nd manipulate time structures
.Sh SYNOPSIS
.In sys/time.h
@@ -73,6 +75,10 @@
.Fn timespecsub "struct timespec *a" "struct timespec *b" "struct timespec *c"
.Ft void
.Fn timespecadd "struct timespec *a" "struct timespec *b" "struct timespec *c"
+.Ft void
+.Fn TIMEVAL_TO_TIMESPEC "struct timeval *tv" "struct timespec *ts"
+.Ft void
+.Fn TIMESPEC_TO_TIMEVAL "struct timeval *tv" "struct timespec *ts"
.Sh DESCRIPTION
The
.Fn timer*
@@ -133,6 +139,20 @@ to
.Fa a
and store the result in
.Fa c .
+.It Fn TIMEVAL_TO_TIMESPEC tv ts
+Convert
+.Fa tv
+to a
+.Vt struct timespec
+and store the result in
+.Fa ts .
+.It Fn TIMESPEC_TO_TIMEVAL tv ts
+Convert
+.Fa ts
+to a
+.Vt struct timeval
+and store the result in
+.Fa tv .
.El
.Sh RETURN VALUES
The macros returning
@@ -162,6 +182,11 @@ and
.Fn timercmp
first appeared in
.Bx 4.1c ,
+.Fn TIMEVAL_TO_TIMESPEC
+and
+.Fn TIMESPEC_TO_TIMEVAL
+in
+.Bx 4.4 ,
.Fn timersub
and
.Fn timeradd
@@ -171,3 +196,7 @@ and
.Fn timerisvalid
in
.Ox 6.5 .
+.Sh CAVEATS
+The argument ordering for
+.Fn TIMESPEC_TO_TIMEVAL
+is unintuitive.