Svante Signell <svante.sign...@gmail.com> writes:

> How much effort is it to implement lwip_poll?

lwip_select constructs a struct lwip_select_cb on the stack
and adds that to the global linked list select_cb_list.
event_callback searches the list for structures that relate
to a particular socket, and wakes up the corresponding threads
so that the lwip_select calls will return.

One would have to
- change struct lwip_select_cb so that it can carry a
  struct pollfd * as an alternative for the three fd_sets;
- copy lwip_select and lwip_selscan to new functions and
  make them use struct pollfd;
- change event_callback to check whether the struct
  lwip_select_cb was made by lwip_poll, and run a linear
  search on the struct pollfd array if so.

All of those are defined in api/sockets.c and struct
lwip_select_cb is of course not referenced elsewhere,
so I don't expect anything else would have to change.

The implementation effort might be 4 hours, not including testing
and publication.  The lwip test suite is not included in the
lwip-hurd tree, but one could implement and test lwip_poll in the
lwip tree and then copy it over.

Reply via email to