diff options
author | Bryan Cantrill <bryan@joyent.com> | 2015-02-23 01:33:27 +0000 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2015-02-23 01:33:27 +0000 |
commit | ff273201ce002a98577917d2f1b407178e7f5033 (patch) | |
tree | c7da73103fe0b19e005d9c29875fd34b14d492b8 /usr/src/uts/common/os/timer.c | |
parent | b2578a0125d357c0a493b1de71be7d6fc2f6ae25 (diff) | |
download | illumos-joyent-ff273201ce002a98577917d2f1b407178e7f5033.tar.gz |
OS-3872 add support for timerfd
Diffstat (limited to 'usr/src/uts/common/os/timer.c')
-rw-r--r-- | usr/src/uts/common/os/timer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/usr/src/uts/common/os/timer.c b/usr/src/uts/common/os/timer.c index 8559d8736c..b25a6cbcf1 100644 --- a/usr/src/uts/common/os/timer.c +++ b/usr/src/uts/common/os/timer.c @@ -269,6 +269,15 @@ clock_add_backend(clockid_t clock, clock_backend_t *backend) clock_backend[clock] = backend; } +clock_backend_t * +clock_get_backend(clockid_t clock) +{ + if (clock < 0 || clock >= CLOCK_MAX) + return (NULL); + + return (clock_backend[clock]); +} + int clock_settime(clockid_t clock, timespec_t *tp) { @@ -398,7 +407,7 @@ timer_signal(sigqueue_t *sigq) /* * This routine is called from the clock backend. */ -void +static void timer_fire(itimer_t *it) { proc_t *p; @@ -672,7 +681,7 @@ timer_create(clockid_t clock, struct sigevent *evp, timer_t *tid) * Call on the backend to verify the event argument (or return * EINVAL if this clock type does not support timers). */ - if ((error = backend->clk_timer_create(it, &ev)) != 0) + if ((error = backend->clk_timer_create(it, timer_fire)) != 0) goto err; it->it_lwp = ttolwp(curthread); |