Page MenuHomeFreeBSD

D25525.1775440852.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D25525.1775440852.diff

Index: share/man/man3/timeradd.3
===================================================================
--- share/man/man3/timeradd.3
+++ share/man/man3/timeradd.3
@@ -27,13 +27,14 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 30, 2018
+.Dd June 30, 2020
.Dt TIMERADD 3
.Os
.Sh NAME
.Nm timeradd ,
.Nm timersub ,
.Nm timerclear ,
+.Nm timeisvalid,
.Nm timerisset ,
.Nm timercmp ,
.Nm timespecadd ,
@@ -51,6 +52,8 @@
.Ft void
.Fn timerclear "struct timeval *tvp"
.Ft int
+.Fn timerisvalid "struct timespec *a"
+.Ft int
.Fn timerisset "struct timeval *tvp"
.Ft int
.Fn timercmp "struct timeval *a" "struct timeval *b" CMP
@@ -130,6 +133,11 @@
.Fn timespecclear
initialize their argument to midnight (0 hour) January 1st, 1970 (the Epoch).
.Pp
+.Fn timerisvalid a
+tests if the microsecond value in
+.Fa a
+is greater than or equal to zero and less than one million.
+.Pp
.Fn timerisset
and
.Fn timespecisset
Index: sys/sys/time.h
===================================================================
--- sys/sys/time.h
+++ sys/sys/time.h
@@ -434,6 +434,8 @@
(vvp)->tv_usec += 1000000; \
} \
} while (0)
+#define timerisvalid(tvp) \
+ ((tvp)->tv_usec >= 0 && (tvp)->tv_usec < 1000000)
#endif
/*

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 6, 2:00 AM (9 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28270452
Default Alt Text
D25525.1775440852.diff (1 KB)

Event Timeline