Ignore:
Timestamp:
Oct 14, 2008, 2:00:40 AM (13 years ago)
Author:
gb
Message:

Stop wrapping (pseudo) file-descriptors around Windows file handlers;
there seem to be cases where this definitely loses, because the MSVCRT
runtime tries to flush buffers associated with (e.g.) a listening socket
when it's closed, and we often have to do I/O in Windows-specific ways
and can't always use the C runtime, anyway.

Handles are (depending on which function you're dealing with) either
pointers or pointer-sized integers; they can be used interchangably
with ints on Win32, but porting this change to Win64 may require some
changes (in l1-io.lisp, in the PIPE function, perhaps elsewhere.)

Supporting this requires some changss in the kernel (mostly in
windows-calls.c) To bootstrap it, most of the I/O functions in
that file assume that very small integers [0 .. 31] are fds wrapped
around a handle and that anything larger is the handle itself. All
of the actual work done by those functions is done on the handle,
without involving the C runtime.

I'll check in a win32 kernel and image in a few minutes. Mixing
older kernels/images won't work, but I don't want to change the
kernel/image compatibility stuff until this is further along.

SLIME sort of works, but not very reliably yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/db-io.lisp

    r10879 r11081  
    113113        (if (eql handle *windows-invalid-handle*)
    114114          (error "Error opening CDB database ~S" pathname)
    115           (#__open_osfhandle (%ptr-to-int handle) #$O_RDONLY)))))
     115          (%ptr-to-int handle)))))
    116116 
    117117 
Note: See TracChangeset for help on using the changeset viewer.