From: James B. <ja...@ja...> - 2006-01-13 19:37:39
|
Hi, The attached patch, along with the new file src/code/win32.lisp, replaces the calls to select in fd-streams with Win32 API calls (and creates an SB-WIN32 package for them to live in). It also depends on Lu=C3=ADs's stdcall patch from a few days ago. (Apologies if this doesn't apply cleanly to HEAD---I tried to keep it updated, but due to the need to use -kb with CVS on Windows, none of the source files are mergeable...) The select wrapper in the Win32 runtime cannot work for all possible file handles. Currently, it will immediately return indicating available input regardless of whether a read will block, for all file descriptors except console handles. The patch replaces the simple cases where code uses unix-select to check for input on a single file descriptor without blocking. This fixes problems with CLEAR-INPUT and READ-CHAR-NO-HANG going into infinite loops when stdin was a pipe and select was lying to them. Even once a proper wrapper for select/poll is ready, it's going to be pretty heavyweight compared to a UNIX select---we'll want to avoid using it unless we really need to block on multiple fds. It's now possible to run SBCL/Win32 inside Emacs with M-x run-lisp, which gets things closer to feeling like home... ;-) |