let make_symlink ~target ~link_path =
wrap_deferred (fun () -> Lwt_unix.symlink target link_path)
~on_exn:(fun e ->
begin match e with
| Unix.Unix_error (Unix.EEXIST, cmd, arg) ->
(`System (`Make_symlink (target, link_path), `File_exists link_path))
| e -> (`System (`Make_symlink (target, link_path), `Exn e))
end)