[Bug 9425] Select behavior different on Wine

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Feb 8 14:15:35 CST 2012


http://bugs.winehq.org/show_bug.cgi?id=9425

--- Comment #28 from Ruediger Meier <sweet_f_a at gmx.de> 2012-02-08 14:15:35 CST ---
(In reply to comment #26)
> (In reply to comment #25)
> > Does anybody still remember why exactly we've applied  0082973d "Convert
> > WS_select to use poll() instead of select()".
> 
> For one thing, select is limited in the number of files it can select on, to
> FD_SETSIZE.

Don't we have that on Windows even limited to 64 per default? Or is this a
problem in wine because fds are all living together in wineserver?

However I see the current select emulation broken in several ways:

1. POLLHUP can happen always without subscribing it.
Since a file descriptor can (and usually will) be listed twice in our pollfd
array it's undefined which particular pollfd struct will receive a POLLHUP. I
saw any thinkable cases happen. It's only luck if a POLLHUP will finally make
it into exceptfds.

2. IMO it's questionable whether we should always put POLLHUP into exceptfds at
all.

3. Since we ignore some events (so possibly all events) we must poll again to
really timeout instead of returning 0 without timeouting.

4. POLLPRI (OOB data) is completely ignored currently.

5. What about POLLERR and POLLNVAL? Can't they happen because of our checks
before calling poll?


To fix 1. we need would need a real mapping fd -> "select fds" rather than just
mapping array positions. If we had this then we also could more cleanly sort
the events into the right "select fds" when we think about 2-5.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list