Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
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 8a42c43
Show file tree
Hide file tree
Showing 3 changed files with 365 additions and 186 deletions.
2 changes: 1 addition & 1 deletion include/uv-private/uv-win.h
Expand Up @@ -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; \
Expand Down
12 changes: 9 additions & 3 deletions include/uv.h
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;

/*
Expand Down

0 comments on commit 8a42c43

Please sign in to comment.