Am Montag, den 24.03.2014, 19:23 +0100 schrieb Johan Grande: > Hi, > > In the following program, the child process "cat" never terminates. I > don't understand why; can anyone tell me? Because outdescr isn't closed in the child. Set the close-on-exec flag on it. Gerd > ~~~ > let _ = > let open Unix in > let indescr, outdescr = pipe () in > let outchan = out_channel_of_descr outdescr in > let pid = > create_process "/bin/cat" [|"cat"|] > indescr stdout stderr > in > Printf.fprintf outchan "Hello!\n%!"; > close indescr; > close outdescr; > ignore (waitpid [] pid) (* stuck here *) > ~~~ > > -- > Johan Grande > -- ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------