Module Name:    src
Committed By:   jruoho
Date:           Tue May 18 09:07:38 UTC 2010

Modified Files:
        src/distrib/sets/lists/comp: mi
        src/share/man/man3: Makefile timeradd.3

Log Message:
Describe also the timespec() family of macros in timeradd(3).


To generate a diff of this commit:
cvs rdiff -u -r1.1449 -r1.1450 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.52 -r1.53 src/share/man/man3/Makefile
cvs rdiff -u -r1.3 -r1.4 src/share/man/man3/timeradd.3

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.1449 src/distrib/sets/lists/comp/mi:1.1450
--- src/distrib/sets/lists/comp/mi:1.1449	Mon May 17 17:15:42 2010
+++ src/distrib/sets/lists/comp/mi	Tue May 18 09:07:37 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.1449 2010/05/17 17:15:42 jruoho Exp $
+#	$NetBSD: mi,v 1.1450 2010/05/18 09:07:37 jruoho Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -8227,6 +8227,11 @@
 ./usr/share/man/cat3/timersub.0			comp-c-catman		.cat
 ./usr/share/man/cat3/times.0			comp-c-catman		.cat
 ./usr/share/man/cat3/timespec.0			comp-c-catman		.cat
+./usr/share/man/cat3/timespecadd.0		comp-c-catman		.cat
+./usr/share/man/cat3/timespecclear.0		comp-c-catman		.cat
+./usr/share/man/cat3/timespeccmp.0		comp-c-catman		.cat
+./usr/share/man/cat3/timespecisset.0		comp-c-catman		.cat
+./usr/share/man/cat3/timespecsub.0		comp-c-catman		.cat
 ./usr/share/man/cat3/timeval.0			comp-c-catman		.cat
 ./usr/share/man/cat3/timezone.0			comp-c-catman		.cat
 ./usr/share/man/cat3/tmpfile.0			comp-c-catman		.cat
@@ -13991,6 +13996,11 @@
 ./usr/share/man/html3/timersub.html		comp-c-htmlman		html
 ./usr/share/man/html3/times.html		comp-c-htmlman		html
 ./usr/share/man/html3/timespec.html		comp-c-htmlman		html
+./usr/share/man/html3/timespecadd.html		comp-c-htmlman		html
+./usr/share/man/html3/timespecclear.html	comp-c-htmlman		html
+./usr/share/man/html3/timespeccmp.html		comp-c-htmlman		html
+./usr/share/man/html3/timespecisset.html	comp-c-htmlman		html
+./usr/share/man/html3/timespecsub.html		comp-c-htmlman		html
 ./usr/share/man/html3/timeval.html		comp-c-htmlman		html
 ./usr/share/man/html3/timezone.html		comp-c-htmlman		html
 ./usr/share/man/html3/tmpfile.html		comp-c-htmlman		html
@@ -19825,6 +19835,11 @@
 ./usr/share/man/man3/timersub.3			comp-c-man		.man
 ./usr/share/man/man3/times.3			comp-c-man		.man
 ./usr/share/man/man3/timespec.3			comp-c-man		.man
+./usr/share/man/man3/timespecadd.3		comp-c-man		.man
+./usr/share/man/man3/timespecclear.3		comp-c-man		.man
+./usr/share/man/man3/timespeccmp.3		comp-c-man		.man
+./usr/share/man/man3/timespecisset.3		comp-c-man		.man
+./usr/share/man/man3/timespecsub.3		comp-c-man		.man
 ./usr/share/man/man3/timeval.3			comp-c-man		.man
 ./usr/share/man/man3/timezone.3			comp-c-man		.man
 ./usr/share/man/man3/tmpfile.3			comp-c-man		.man

Index: src/share/man/man3/Makefile
diff -u src/share/man/man3/Makefile:1.52 src/share/man/man3/Makefile:1.53
--- src/share/man/man3/Makefile:1.52	Mon May 17 07:10:16 2010
+++ src/share/man/man3/Makefile	Tue May 18 09:07:38 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.52 2010/05/17 07:10:16 jruoho Exp $
+#	$NetBSD: Makefile,v 1.53 2010/05/18 09:07:38 jruoho Exp $
 #	@(#)Makefile	8.2 (Berkeley) 12/13/93
 
 MAN=	_DIAGASSERT.3 __CONCAT.3 __UNCONST.3 CMSG_DATA.3 \
@@ -208,7 +208,12 @@
 MLINKS+=timeradd.3 timersub.3 \
 	timeradd.3 timerclear.3 \
 	timeradd.3 timerisset.3 \
-	timeradd.3 timercmp.3
+	timeradd.3 timercmp.3 \
+	timeradd.3 timespecadd.3 \
+	timeradd.3 timespecsub.3 \
+	timeradd.3 timespecclear.3 \
+	timeradd.3 timespecisset.3 \
+	timeradd.3 timespeccmp.3
 MLINKS+=timeval.3 timespec.3 \
 	timeval.3 itimerval.3 \
 	timeval.3 itimerspec.3 \

Index: src/share/man/man3/timeradd.3
diff -u src/share/man/man3/timeradd.3:1.3 src/share/man/man3/timeradd.3:1.4
--- src/share/man/man3/timeradd.3:1.3	Mon May 17 07:22:03 2010
+++ src/share/man/man3/timeradd.3	Tue May 18 09:07:38 2010
@@ -1,4 +1,6 @@
-.\" $NetBSD: timeradd.3,v 1.3 2010/05/17 07:22:03 jruoho Exp $
+.\" $NetBSD: timeradd.3,v 1.4 2010/05/18 09:07:38 jruoho Exp $
+.\"
+.\" Copyright (c) 2009 Jukka Ruohonen <[email protected]>
 .\" Copyright (c) 1999 Kelly Yancey <[email protected]>
 .\" All rights reserved.
 .\"
@@ -32,11 +34,7 @@
 .Dt TIMERADD 3
 .Os
 .Sh NAME
-.Nm timeradd ,
-.Nm timersub ,
-.Nm timerclear ,
-.Nm timerisset ,
-.Nm timercmp
+.Nm timeradd
 .Nd operations on timevals
 .Sh SYNOPSIS
 .In sys/time.h
@@ -45,65 +43,93 @@
 .Ft void
 .Fn timersub "struct timeval *a" "struct timeval *b" "struct timeval *res"
 .Ft void
-.Fn timerclear "struct timeval *tvp"
+.Fn timerclear "struct timeval *tv"
 .Ft int
-.Fn timerisset "struct timeval *tvp"
+.Fn timerisset "struct timeval *tv"
 .Ft int
 .Fn timercmp "struct timeval *a" "struct timeval *b" CMP
+.Ft void
+.Fn timespecadd "struct timespec *a" \
+"struct timespec *b" "struct timespec *res"
+.Ft void
+.Fn timespecsub "struct timespec *a" \
+"struct timespec *b" "struct timespec *res"
+.Ft void
+.Fn timespecclear "struct timespec *ts"
+.Ft int
+.Fn timespecisset "struct timespec *ts"
+.Ft int
+.Fn timespeccmp "struct timespec *a" "struct timespec b" CMP
 .Sh DESCRIPTION
-These macros are provided for manipulating
+These macros are provided for manipulating the
 .Fa timeval
-structures for use with the
-.Xr gettimeofday 2
 and
-.Xr settimeofday 2
-calls.
-The structure is described in
+.Fa timespec
+structures described in
 .Xr timeval 3 .
 .Pp
+The
 .Fn timeradd
-adds the time information stored in
+and
+.Fn timespecadd
+macros add the time information stored in
 .Fa a
 to
-.Fa b
-and stores the resulting
-.Vt timeval
-in
+.Fa b ,
+storing the result in
 .Fa res .
-The results are simplified such that the value of
+With
+.Fn timeradd
+the results are simplified such that the value of
 .Fa res->tv_usec
 is always less than 1,000,000 (1 second).
+With
+.Fn timespecadd
+the
+.Fa res->tv_nsec
+member of
+.Fa struct timespec
+is always less than 1,000,000,000.
 .Pp
+The
 .Fn timersub
-subtracts the time information stored in
+and
+.Fn timespecsub
+macros subtract the time information stored in
 .Fa b
 from
 .Fa a
-and stores the resulting
-.Vt timeval
+and store the resulting structure
 in
 .Fa res .
 .Pp
+The
 .Fn timerclear
-initializes
-.Fa tvp
+and
+.Fn timespecclear
+macros initialize the structures
 to midnight (0 hour) January 1st, 1970 (the Epoch).
+In another words, they set the members of the structure to zero.
 .Pp
+The
 .Fn timerisset
-returns true if
-.Fa tvp
+and
+.Fn timespecisset
+macros return true if the input structure
 is set to any time value other than the Epoch.
 .Pp
+The
 .Fn timercmp
-compares
+and
+.Fn timespeccmp
+compare
 .Fa a
 to
 .Fa b
 using the comparison operator given in
-.Fa CMP ,
-and returns the result of that comparison.
+.Fa CMP .
+The result of the comparison is returned.
 .Sh SEE ALSO
-.Xr gettimeofday 2 ,
 .Xr timeval 3
 .Sh HISTORY
 The
@@ -112,3 +138,7 @@
 .Nx 1.1 .
 These were later ported to
 .Fx 2.2.6 .
+The
+.Fn timespec
+family of functions first appeared in
+.Nx 1.2 .

Reply via email to