Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142087792
D50075.id154480.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
D50075.id154480.diff
View Options
diff --git a/sys/kern/kern_time.c b/sys/kern/kern_time.c
--- a/sys/kern/kern_time.c
+++ b/sys/kern/kern_time.c
@@ -504,24 +504,27 @@
sbintime_t sbt, sbtt, prec, tmp;
time_t over;
int error;
- bool is_abs_real;
+ bool is_abs_real, precise;
if (rqt->tv_nsec < 0 || rqt->tv_nsec >= NS_PER_SEC)
return (EINVAL);
if ((flags & ~TIMER_ABSTIME) != 0)
return (EINVAL);
+ precise = false;
switch (clock_id) {
case CLOCK_REALTIME:
case CLOCK_REALTIME_PRECISE:
+ precise = true;
case CLOCK_REALTIME_FAST:
case CLOCK_SECOND:
is_abs_real = (flags & TIMER_ABSTIME) != 0;
break;
case CLOCK_MONOTONIC:
- case CLOCK_MONOTONIC_PRECISE:
- case CLOCK_MONOTONIC_FAST:
case CLOCK_UPTIME:
+ case CLOCK_MONOTONIC_PRECISE:
case CLOCK_UPTIME_PRECISE:
+ precise = true;
+ case CLOCK_MONOTONIC_FAST:
case CLOCK_UPTIME_FAST:
is_abs_real = false;
break;
@@ -553,8 +556,7 @@
} else
over = 0;
tmp = tstosbt(ts);
- prec = tmp;
- prec >>= tc_precexp;
+ prec = precise ? 0 : tmp >> tc_precexp;
if (TIMESEL(&sbt, tmp))
sbt += tc_tick_sbt;
sbt += tmp;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 16, 10:37 PM (1 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27671808
Default Alt Text
D50075.id154480.diff (1 KB)
Attached To
Mode
D50075: time: use precise callout for clock_nanosleep(2) and nanosleep(2)
Attached
Detach File
Event Timeline
Log In to Comment