| 1601 | } |
| 1602 | |
| 1603 | static int |
| 1604 | pollout(struct thread *td, struct pollfd *fds, struct pollfd *ufds, u_int nfd) |
| 1605 | { |
| 1606 | int error = 0; |
| 1607 | u_int i = 0; |
| 1608 | u_int n = 0; |
| 1609 | |
| 1610 | for (i = 0; i < nfd; i++) { |
| 1611 | error = copyout(&fds->revents, &ufds->revents, |
| 1612 | sizeof(ufds->revents)); |
| 1613 | if (error) |
| 1614 | return (error); |
| 1615 | if (fds->revents != 0) |
| 1616 | n++; |
| 1617 | fds++; |
| 1618 | ufds++; |
| 1619 | } |
| 1620 | td->td_retval[0] = n; |
| 1621 | return (0); |
| 1622 | } |
| 1623 | |
| 1624 | static int |
| 1625 | pollscan(struct thread *td, struct pollfd *fds, u_int nfd) |