This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

modified poll() patch


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

Attachment: newpoll2.cc
Description: Binary data

Attachment: poll.patch2
Description: Binary data

Attachment: 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/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]