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 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.
Cheers, Kai
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 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
On Mon, Dec 1, 2008 at 11:57 AM, Martin Storsjö martin@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
On Thu, 4 Dec 2008, Damjan Jovanovic wrote:
On Mon, Dec 1, 2008 at 11:57 AM, Martin Storsjö martin@martin.st wrote:
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).
Ah, thanks for pointing this out.
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*.
So, what would be the correct and clean way of conditionally enabling this?
The broken poll behaviour could be checked with this kind of snippet:
#include <poll.h>
int main(int argc, char** argv) { struct pollfd pfd; pfd.fd = 0; pfd.events = POLLIN; poll(&pfd, 1, 0); return (pfd.revents & POLLNVAL) ? 1 : 0; }
Should this kind of detection be welded into configure in some way?
Or would it be better to simply define e.g. POLL_BROKEN whenever building for Darwin? That way, the binary would work well on all versions even if built on some newer version, if they would happen to fix the bug there.
Regards, // Martin