poll-loop: Make poll_fd_wait_event() cross-platform.
authorGurucharan Shetty <gshetty@nicira.com>
Wed, 5 Feb 2014 18:10:10 +0000 (10:10 -0800)
committerGurucharan Shetty <gshetty@nicira.com>
Tue, 11 Feb 2014 17:55:47 +0000 (09:55 -0800)
commit55489d31a66b39aa7b41ed07a19f0bd7d7fbdd11
treeb3b0c533f93c95e9ee44ab7f5cb72b49de82842e
parent7daaec4e04fbeced8c81c3182e1dae31952d54b3
poll-loop: Make poll_fd_wait_event() cross-platform.

This is helpful if we want to wait either on 'fd' for POSIX or
events for Windows.

For Windows, if both 'fd' and 'wevent' is specified, we associate
that event with the 'fd' using WSAEventSelect() in poll_block().
So any 'events' on that 'fd' will wake us up from WaitForMultipleObjects().

WSAEventSelect() does not understand  POLLIN, POLLOUT etc.  Instead the
macros it understands are FD_READ, FD_ACCEPT, FD_CONNECT, FD_CLOSE etc.
So we need to make that transition.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
lib/poll-loop.c
lib/poll-loop.h