timerfd: Suppress kqueue readability after jump read
Do not report EVFILT_READ after reading a discontinuous clock jump. This makes the kqueue filter consistent with Linux epoll behavior and timerfd_poll(), which already checks tfd_jumped != TFD_READ before reporting POLLIN. MFC after: 2 weeks
This commit is contained in:
@@ -290,7 +290,7 @@ filt_timerfdread(struct knote *kn, long hint)
|
||||
|
||||
mtx_assert(&tfd->tfd_lock, MA_OWNED);
|
||||
kn->kn_data = (int64_t)tfd->tfd_count;
|
||||
return (tfd->tfd_count > 0);
|
||||
return (tfd->tfd_count > 0 && tfd->tfd_jumped != TFD_READ);
|
||||
}
|
||||
|
||||
static const struct filterops timerfd_rfiltops = {
|
||||
|
||||
Reference in New Issue
Block a user