win: open child stdio handles in overlapped-mode (#8113)

This will be used e.g. by the python client for native asyncio support
This commit is contained in:
Björn Linse
2018-04-25 10:11:08 +02:00
committed by Justin M. Keyes
parent a369385009
commit 009ccfe170
3 changed files with 50 additions and 1 deletions

View File

@@ -51,12 +51,19 @@ int libuv_process_spawn(LibuvProcess *uvproc)
if (!proc->in.closed) {
uvproc->uvstdio[0].flags = UV_CREATE_PIPE | UV_READABLE_PIPE;
#ifdef WIN32
uvproc->uvstdio[0].flags |= UV_OVERLAPPED_PIPE;
#endif
uvproc->uvstdio[0].data.stream = STRUCT_CAST(uv_stream_t,
&proc->in.uv.pipe);
}
if (!proc->out.closed) {
uvproc->uvstdio[1].flags = UV_CREATE_PIPE | UV_WRITABLE_PIPE;
#ifdef WIN32
// pipe must be readable for IOCP to work.
uvproc->uvstdio[1].flags |= UV_READABLE_PIPE | UV_OVERLAPPED_PIPE;
#endif
uvproc->uvstdio[1].data.stream = STRUCT_CAST(uv_stream_t,
&proc->out.uv.pipe);
}