Derek Price wrote: >The code that selects on the fd in fd_buffer_input is about a year old >now, and was contained in at least 1.12.12, so I'm unsure why this >problem just started cropping up now. Is it possible that something >changed in the code that starts up the windows :ext: server such that >the piped_child function started returning an fd rather than a socket? > >
Incidentally, if you wanted to provide a replacement select() function on Windows, here is how Cygwin did it (from http://sources.redhat.com/cygwin/cygwin-ug-net/highlights.html): Select The UNIX select function is another call that does not map cleanly on top of the Win32 API. Much to our dismay, we discovered that the Win32 select in Winsock only worked on socket handles. Our implementation allows select to function normally when given different types of file descriptors (sockets, pipes, handles, and a custom /dev/windows Windows messages pseudo-device). Upon entry into the select function, the first operation is to sort the file descriptors into the different types. There are then two cases to consider. The simple case is when at least one file descriptor is a type that is always known to be ready (such as a disk file). In that case, select returns immediately as soon as it has polled each of the other types to see if they are ready. The more complex case involves waiting for socket or pipe file descriptors to be ready. This is accomplished by the main thread suspending itself, after starting one thread for each type of file descriptor present. Each thread polls the file descriptors of its respective type with the appropriate Win32 API call. As soon as a thread identifies a ready descriptor, that thread signals the main thread to wake up. This case is now the same as the first one since we know at least one descriptor is ready. So select returns, after polling all of the file descriptors one last time. The POSIX specification for select is here: <http://www.opengroup.org/onlinepubs/009695399/functions/select.html>. For now, I think it would only need to handle files (Cygwin says files are always ready for read on Windows), sockets (Windows select() can be used), and pipes (I have no idea how to find out if a pipe is ready for read on Windows). Of course, figuring out why this behavior changed since 1.12.12 might be easier. Regards, Derek -- Derek R. Price CVS Solutions Architect Ximbiot <http://ximbiot.com> v: +1 717.579.6168 f: +1 717.234.3125 <mailto:[EMAIL PROTECTED]> _______________________________________________ Bug-cvs mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/bug-cvs
