diff options
Diffstat (limited to 'otherlibs/threads/threadUnix.ml')
-rw-r--r-- | otherlibs/threads/threadUnix.ml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/otherlibs/threads/threadUnix.ml b/otherlibs/threads/threadUnix.ml index 3fc51ac37..823d0c5a2 100644 --- a/otherlibs/threads/threadUnix.ml +++ b/otherlibs/threads/threadUnix.ml @@ -89,6 +89,11 @@ let pipe() = Unix.set_nonblock out_fd; fd_pair +let open_process_in cmd = + let ic = Unix.open_process_in cmd in + Unix.set_nonblock(Unix.descr_of_in_channel ic); + oc + let open_process_out cmd = let oc = Unix.open_process_out cmd in Unix.set_nonblock(Unix.descr_of_out_channel oc); @@ -96,7 +101,15 @@ let open_process_out cmd = let open_process cmd = let (ic, oc as channels) = Unix.open_process cmd in + Unix.set_nonblock(Unix.descr_of_in_channel ic); + Unix.set_nonblock(Unix.descr_of_out_channel oc); + channels + +let open_process_full cmd env = + let (ic, oc, ec as channels) = Unix.open_process_full cmd env in + Unix.set_nonblock(Unix.descr_of_in_channel ic); Unix.set_nonblock(Unix.descr_of_out_channel oc); + Unix.set_nonblock(Unix.descr_of_out_channel ec); channels (*** Time *) |