Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

windows: improve spawn stdio support

* Make using an existing stream for stdio actually work
* Support up to 256 stdio channels
* Fix some minor bugs
  • Loading branch information...
piscisaureus committed May 31, 2012
1 parent 44c72a9 commit 8a42c43e4fb9a0c22525c3114336d4085c1accb7
Showing with 365 additions and 186 deletions.
  1. +1 −1 include/uv-private/uv-win.h
  2. +9 −3 include/uv.h
  3. +355 −182 src/win/process.c
@@ -454,7 +454,7 @@ RB_HEAD(uv_timer_tree_s, uv_timer_s);
struct uv_process_close_s { \
UV_REQ_FIELDS \
} close_req; \
HANDLE child_stdio[3]; \
void* child_stdio_buffer; \
int exit_signal; \
DWORD spawn_errno; \
HANDLE wait_handle; \
@@ -1175,7 +1175,7 @@ typedef enum {
* flags may be specified to create a duplex data stream.
*/
UV_READABLE_PIPE = 0x10,
UV_WRITABLE_PIPE = 0x20,
UV_WRITABLE_PIPE = 0x20
} uv_stdio_flags;

typedef struct uv_stdio_container_s {
@@ -1221,10 +1221,16 @@ typedef struct uv_process_options_s {
uv_gid_t gid;

/*
* A container of stdio streams (stdin/stdout/stderr)
* The `stdio` field points to an array of uv_stdio_container_t structs that
* describe the file descriptors that will be made available to the child
* process. The convention is that stdio[0] points to stdin, fd 1 is used for
* stdout, and fd 2 is stderr.
*
* Note that on windows file descriptors greater than 2 are available to the
* child process only if the child processes uses the MSVCRT runtime.
*/
uv_stdio_container_t* stdio;
int stdio_count;
uv_stdio_container_t* stdio;
} uv_process_options_t;

/*

0 comments on commit 8a42c43

Please sign in to comment.
You can’t perform that action at this time.