modified poll() patch

Boris Schaeling boriss@web.de
Sat Mar 16 10:47:00 GMT 2002


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: newpoll2.cc
Type: application/octet-stream
Size: 2702 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020316/ec05037d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poll.patch2
Type: application/octet-stream
Size: 3635 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020316/ec05037d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: polltest2.c
Type: application/octet-stream
Size: 1296 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20020316/ec05037d/attachment-0002.obj>
-------------- next part --------------
--
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/


More information about the Cygwin mailing list