| 1649 | } |
| 1650 | |
| 1651 | int |
| 1652 | ff_kevent_do_each(int kq, const struct kevent *changelist, int nchanges, |
| 1653 | void *eventlist, int nevents, const struct timespec *timeout, |
| 1654 | void (*do_each)(void **, struct kevent *)) |
| 1655 | { |
| 1656 | int rc; |
| 1657 | struct timespec ts; |
| 1658 | ts.tv_sec = 0; |
| 1659 | ts.tv_nsec = 0; |
| 1660 | |
| 1661 | struct sys_kevent_args ska = { |
| 1662 | kq, |
| 1663 | changelist, |
| 1664 | nchanges, |
| 1665 | eventlist, |
| 1666 | nevents, |
| 1667 | &ts, |
| 1668 | do_each |
| 1669 | }; |
| 1670 | |
| 1671 | struct kevent_copyops k_ops = { |
| 1672 | &ska, |
| 1673 | kevent_copyout, |
| 1674 | kevent_copyin |
| 1675 | }; |
| 1676 | |
| 1677 | if ((rc = kern_kevent(curthread, kq, nchanges, nevents, &k_ops, |
| 1678 | &ts))) |
| 1679 | goto kern_fail; |
| 1680 | |
| 1681 | rc = curthread->td_retval[0]; |
| 1682 | return (rc); |
| 1683 | kern_fail: |
| 1684 | ff_os_errno(rc); |
| 1685 | return (-1); |
| 1686 | } |
| 1687 | |
| 1688 | int |
| 1689 | ff_kevent(int kq, const struct kevent *changelist, int nchanges, |
no test coverage detected