summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Cantrill <bryan@joyent.com>2012-01-03 08:38:10 +0000
committerBryan Cantrill <bryan@joyent.com>2012-01-03 08:38:10 +0000
commit5d977ce82a18e6a1380c7a918bcfa3d40216d410 (patch)
treeea9125d2f5e2b3591f93a7ae8608632ee7491a91
parente469c0531a4ed9f2ebea5a1bb397b3cf6b48a361 (diff)
downloadillumos-joyent-5d977ce82a18e6a1380c7a918bcfa3d40216d410.tar.gz
OS-841 timer intervals incorrectly rounded to clock resolution
-rw-r--r--usr/src/uts/common/os/timer.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/usr/src/uts/common/os/timer.c b/usr/src/uts/common/os/timer.c
index 57c1ed97bd..57e369adca 100644
--- a/usr/src/uts/common/os/timer.c
+++ b/usr/src/uts/common/os/timer.c
@@ -24,7 +24,9 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ */
#include <sys/timer.h>
#include <sys/systm.h>
@@ -772,25 +774,6 @@ timer_settime(timer_t tid, int flags, itimerspec_t *val, itimerspec_t *oval)
if ((it = timer_grab(p, tid)) == NULL)
return (set_errno(EINVAL));
- /*
- * From the man page:
- * Time values that are between two consecutive non-negative
- * integer multiples of the resolution of the specified timer
- * shall be rounded up to the larger multiple of the resolution.
- * We assume that the resolution of any clock is less than one second.
- */
- if (it->it_backend->clk_clock_getres(&res) == 0 && res.tv_nsec > 1) {
- long rem;
-
- if ((rem = when.it_interval.tv_nsec % res.tv_nsec) != 0) {
- when.it_interval.tv_nsec += res.tv_nsec - rem;
- timespecfix(&when.it_interval);
- }
- if ((rem = when.it_value.tv_nsec % res.tv_nsec) != 0) {
- when.it_value.tv_nsec += res.tv_nsec - rem;
- timespecfix(&when.it_value);
- }
- }
error = it->it_backend->clk_timer_settime(it, flags, &when);
timer_release(p, it);