Module Name:    src
Committed By:   jruoho
Date:           Thu May 20 05:37:58 UTC 2010

Modified Files:
        src/share/man/man3: timeval.3

Log Message:
Note clock_gettime(2) in the example.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man3/timeval.3

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man3/timeval.3
diff -u src/share/man/man3/timeval.3:1.9 src/share/man/man3/timeval.3:1.10
--- src/share/man/man3/timeval.3:1.9	Wed May 19 13:41:39 2010
+++ src/share/man/man3/timeval.3	Thu May 20 05:37:58 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: timeval.3,v 1.9 2010/05/19 13:41:39 tsutsui Exp $
+.\" $NetBSD: timeval.3,v 1.10 2010/05/20 05:37:58 jruoho Exp $
 .\"
 .\" Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 19, 2010
+.Dd May 20, 2010
 .Dt TIMEVAL 3
 .Os
 .Sh NAME
@@ -171,15 +171,17 @@
 {
 	struct timeval elapsed;
 
-	_DIAGASSERT(spec != NULL);
-
 	(void)gettimeofday(&elapsed, NULL);
 
+	_DIAGASSERT(spec != NULL);
 	TIMEVAL_TO_TIMESPEC(&elapsed, spec);
 
 	/* Add the offset for timeout in minutes. */
 	spec->tv_sec = spec->tv_sec + minutes * 60;
 }
 .Ed
+.Pp
+A better alternative would use the more precise
+.Xr clock_gettime 2 .
 .Sh SEE ALSO
 .Xr timeradd 3

Reply via email to