win32-fh work, mostly RUN-PROGRAM-related. Solid on Unix, not on Win32
commita6b9273ba518274727a3e1c528192ef4d191db1e
authorRichard M Kreuter <kreuter@progn.net>
Tue, 19 Feb 2008 16:29:16 +0000 (19 11:29 -0500)
committerRichard M Kreuter <kreuter@progn.net>
Tue, 19 Feb 2008 16:29:16 +0000 (19 11:29 -0500)
treeeac41fb9cf55092d25f5b2f8dcb484fca74ff2c5
parenta6b765ff53e8fcb9c8cd7c6660a8226c4173cf69
win32-fh work, mostly RUN-PROGRAM-related.  Solid on Unix, not on Win32

File-by-file breakdown:

* package-data-list.lisp-expr

Add a Lisp-level OPEN-PIPE for use in RUN-PROGRAM.
Add ERROR_BROKEN_PIPE for win32, needed to detect EOF on Windows.
Remove SB-MKSTEMP symbol.

* src/code/fd-stream.lisp

Fix type typo in BUFFER structure (NIL vs. NULL as types).
Teach REFILL-INPUT-BUFFER that ERROR_BROKEN_PIPE means EOF for pipes
on Windows.
Add a function to be called at CLOSE-time for a stream on which
DELETE-FILE has been called.
Add a Lisp-level OPEN-PIPE operation, for RUN-PROGRAM.

* src/code/filesys.lisp

Have DELETE-FILE on a stream not immediately close the stream, but
instead to arrange to delete the file when the stream is closed.

* src/code/run-program.lisp

Everywhere we have used raw file descriptors, replace with Lisp
streams created by OPEN or OPEN-PIPE (this should also prevent various
kinds of leaks in case of unwinds during async interrupts, too).

* src/code/serve-event.lisp

Since Windows doesn't have SIGCHLD, use serve-event to monitor for
asynchronous status changes in children created by CreateProcess().

* src/code/unix.lisp

Remove sb-mkstemp from this file.

* src/code/win32-pathname.lisp

Teach win32 pathnames to filenamify a pathname with NIL for the
directory.

* src/code/win32.lisp

Add internal binding to CreatePipe(), GetExitCodeProcess()

* src/runtime/run-program.c

Add a spawn() that uses CreateProcess().  This doesn't DTRT with
handles yet, but it does return a handle to the process, which we use
in serve-event.

* src/runtime/win32-os.c

Add a runtime constructor for a SECURITY_ATTRIBUTES structure.
Add CreatePipe(), GetExitCodeProcess() to the win32 version of
ldso-stubs.
package-data-list.lisp-expr
src/code/fd-stream.lisp
src/code/filesys.lisp
src/code/run-program.lisp
src/code/serve-event.lisp
src/code/unix.lisp
src/code/win32-pathname.lisp
src/code/win32.lisp
src/runtime/run-program.c
src/runtime/win32-os.c
tools-for-build/grovel-headers.c