open Sys;; open Unix;; let mon_execvp com argv = let com_argv = Array.concat [ [| com |]; argv ] in match fork() with | 0 -> handle_unix_error (fun _ -> execvp com com_argv) () | k -> let rec wait() = try snd (waitpid [] k) with Unix_error (EINTR, _, _) -> wait() in wait() |