| 231 | } |
| 232 | |
| 233 | static int |
| 234 | eventfd_poll(struct file *fp, int events, struct ucred *active_cred, |
| 235 | struct thread *td) |
| 236 | { |
| 237 | struct eventfd *efd; |
| 238 | int revents; |
| 239 | |
| 240 | efd = fp->f_data; |
| 241 | revents = 0; |
| 242 | mtx_lock(&efd->efd_lock); |
| 243 | if ((events & (POLLIN | POLLRDNORM)) != 0 && efd->efd_count > 0) |
| 244 | revents |= events & (POLLIN | POLLRDNORM); |
| 245 | if ((events & (POLLOUT | POLLWRNORM)) != 0 && UINT64_MAX - 1 > |
| 246 | efd->efd_count) |
| 247 | revents |= events & (POLLOUT | POLLWRNORM); |
| 248 | if (revents == 0) |
| 249 | selrecord(td, &efd->efd_sel); |
| 250 | mtx_unlock(&efd->efd_lock); |
| 251 | |
| 252 | return (revents); |
| 253 | } |
| 254 | |
| 255 | static int |
| 256 | eventfd_kqfilter(struct file *fp, struct knote *kn) |
nothing calls this directly
no test coverage detected