Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142018390
D4714.id11705.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D4714.id11705.diff
View Options
Index: lib/libc/sys/clock_gettime.2
===================================================================
--- lib/libc/sys/clock_gettime.2
+++ lib/libc/sys/clock_gettime.2
@@ -138,6 +138,8 @@
was not a valid value.
.It Bq Er EPERM
A user other than the super-user attempted to set the time.
+.It Bq Er EINVAL
+Timespec value is invalid.
.El
.Sh SEE ALSO
.Xr date 1 ,
Index: lib/libc/sys/gettimeofday.2
===================================================================
--- lib/libc/sys/gettimeofday.2
+++ lib/libc/sys/gettimeofday.2
@@ -112,6 +112,8 @@
.Bl -tag -width Er
.It Bq Er EPERM
A user other than the super-user attempted to set the time.
+.It Bq Er EINVAL
+Timeval value is invalid.
.El
.Sh SEE ALSO
.Xr date 1 ,
Index: sys/kern/kern_time.c
===================================================================
--- sys/kern/kern_time.c
+++ sys/kern/kern_time.c
@@ -398,7 +398,8 @@
return (error);
if (clock_id != CLOCK_REALTIME)
return (EINVAL);
- if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000)
+ if (ats->tv_nsec < 0 || ats->tv_nsec >= 1000000000
+ || ats->tv_sec < 0)
return (EINVAL);
/* XXX Don't convert nsec->usec and back */
TIMESPEC_TO_TIMEVAL(&atv, ats);
@@ -618,7 +619,8 @@
return (error);
/* Verify all parameters before changing time. */
if (tv) {
- if (tv->tv_usec < 0 || tv->tv_usec >= 1000000)
+ if (tv->tv_usec < 0 || tv->tv_usec >= 1000000
+ || tv->tv_sec < 0)
return (EINVAL);
error = settime(td, tv);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 12:06 AM (15 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27656179
Default Alt Text
D4714.id11705.diff (1 KB)
Attached To
Mode
D4714: settimeofday system call panic.
Attached
Detach File
Event Timeline
Log In to Comment