Here is the new poll() patch. Now invalid descriptors are recognized (invalid = positive descriptors including 0 which are not open). If there are invalid descriptors poll() returns immediately with the count of invalid descriptors. The timer value is ignored. That's the way Linux handles this case.
As far as I can see there is only one bug left in this poll() function: If a descriptor is closed revents is set to POLLIN and not to POLLHUP. That's the way previous poll() functions worked, too. This shouldn't be a problem as read() will return 0 and tell the application that the socket can be closed. I changed the test case, too (see polltest2.c). Hopefully this poll() doesn't cause any problems any more. Boris
newpoll2.cc
Description: Binary data
poll.patch2
Description: Binary data
polltest2.c
Description: Binary data
-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/