Mostly-working Win32 file handles commit. DO NOT USE THIS COMMIT.
commita6b765ff53e8fcb9c8cd7c6660a8226c4173cf69
authorRichard M Kreuter <kreuter@progn.net>
Mon, 11 Feb 2008 18:28:19 +0000 (11 13:28 -0500)
committerRichard M Kreuter <kreuter@progn.net>
Mon, 11 Feb 2008 18:28:19 +0000 (11 13:28 -0500)
treeb7bb5967a91b015024399a4bd5c4cd9d0c1bf35f
parentd35fdef0b635e10db8d8be2d20ad38e82ee0d23f
Mostly-working Win32 file handles commit.  DO NOT USE THIS COMMIT.

File-by-file changes

* contrib/sb-simple-streams/file.lisp
* contrib/sb-simple-streams/impl.lisp

Remove the UNIX-MODE slot I added earlier in this branch.  Extended
keyword arguments to OPEN/open(2)/CreateFile() are now handled by a
structure in fd-stream.lisp, which knows how to consume arguments to
OPEN.

* package-data-list.lisp-expr

Many new exports around the system: SB-SYS:OS-{OPEN,CLOSE,READ,etc.},
in terms of which FD-STREAMs and eventually SB-SIMPLE-STREAMS can be
implemented.

* src/code/fd-stream.lisp

(Naturally, lots of things here.)

  ** New slot, not yet used, for holding the types of win32 socket
     events that a stream will have to tend to.  (This might be the
     wrong design for bound server sockets that aren't streams;
     dunno.)

  ** Introduce an internal OS-OPEN, that hides the differences between
     open(2) and CreateFile().

  ** Along with OS-OPEN, introduce a defstruct-oid structure type
     OS-OPEN-ARGUMENTS, which can be construed as a mostly-opaque
     object wherever it's passed around.  The API is slightly
     pathnames-like, with a MERGE-OS-OPEN-ARGUMENTS operator.

  ** Fix a bug in FILE-LENGTH introduced in the previous commit.
     (Failed to truncate the number of octets in the file by the
     number of octets in the stream's element-type, so FILE-LENGTH on
     streams with element-type larger than (unsigned-byte 8) lost.)

  ** Remove sb-mkstemp.  The functionality has been implemented in
     Lisp in this branch for a while now, and it turns out to
     simplify things to dispense with mkstemp's division of labor.

  ** Reintroduce the exact, peculiar behavior for an aborting CLOSE of
     a stream opened with :SUPERSEDE where the file already existed.
     (This behavior is a dumb misreading of the standard, but it
     should leave the semantics of SBCL almost completely unchanged
     in a build without either OPEN-SUPERSEDE-IS-RENAME-AND-DELETE.

  ** Refactor OPEN-FILE again, to better accomodate
     :WIN32-USES-FILE-HANDLES and to work without SB-MKSTEMP.

* src/code/filesys.lisp

Rewrite DELETE-FILE, getting rid of UNIX-NAMESTRING, and having it
defer the close() and the unlink() on an open FILE-STREAM until
CLOSE-time.  This will be useful in RUN-PROGRAM, and also perhaps for
users.

* src/code/serve-event.lisp

Use Alastair Bridgewater's SUB-SERVE-EVENT for Win32 file handles.

* src/code/win32.lisp

Support code for SUB-SERVE-EVENT for Win32 file handles.

* src/runtime/Config.x86-win32

Link to ws2_32 (at least on XP... will this work elsewhere?).  Needed
for SUB-SERVE-EVENT on sockets.

* src/runtime/win32-os.c

More support for SUB-SERVE-EVENT with Win32 file handles.
contrib/sb-simple-streams/file.lisp
contrib/sb-simple-streams/impl.lisp
package-data-list.lisp-expr
src/code/fd-stream.lisp
src/code/filesys.lisp
src/code/serve-event.lisp
src/code/win32.lisp
src/runtime/Config.x86-win32
src/runtime/win32-os.c