wineconsole: Wait on events in curses backend using select instead of poll

Damjan Jovanovic damjan.jov at gmail.com
Thu Dec 4 01:10:09 CST 2008


On Mon, Dec 1, 2008 at 11:57 AM, Martin Storsjö <martin at martin.st> wrote:
> On Mon, 1 Dec 2008, Kai Blin wrote:
>
>> On Sunday 30 November 2008 00:52:57 Martin Storsjö wrote:
>>>
>>> poll can't handle terminal devices on Darwin, since Tiger. See the
>>> following discussion:
>>> http://lists.apple.com/archives/Darwin-dev/2006/Apr/msg00066.html
>>
>> There's reasons we switched from select to poll. You can't just switch
>> back to
>
> As far as I can tell from the history of curses.c, it never used select
> (directly) before, it used WaitForMultipleObjects, which was changed into a
> poll in 267d38e1bc78541221d20cc72a759acc78908e8e, "wineconsole: Don't use a
> Win32 wait on a Unix file descriptor."
>
> But there may of course be other reasons for using poll, which I don't know
> about.

select() not only has a hard limit on the number of file descriptors
(1024 or whatever) that can only be increased at kernel and libc build
time, but also has a corresponding limit on the maximum file
descriptor that can be selected (1023).

On the other hand, console handles presumably exist on the low file
descriptors (0, 1, and 2 - though doesn't transferring fds from the
wineserver result in call to dup() which can change that?) and we poll
very few of them, so those could possibly be done using select() - on
MacOS *only*.

>
>> select to work around a OSX _bug_. If Apple can't get their act together
>> to
>> fix this, this needs to go behind a configure check/ifdef.
>
> Yes, that's true.
>
> I'm not too familiar with the wine codebase and customs, so instead of
> nagging you with questions on what a proper solution would look like, should
> I just file a bug with the actual issue; that the curses based console is
> unusable on Darwin at the moment?
>
> // Martin
>
>
>

Damjan



More information about the wine-devel mailing list