Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144556505
D25525.1775440852.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25525.1775440852.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25525: Add timerisvalid() from OpenBSD
Attached
Detach File
Event Timeline
Log In to Comment