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:
Jake Freeland
2026-03-20 01:34:15 -05:00
parent b11fba4126
commit 33345b8834
+1 -1
View File
@@ -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 = {