This repository has no description
1open Eio.Std
2
3let ( / ) = Eio.Path.( / )
4
5let copy_hey fs =
6 let temp_dir = Filename.temp_dir "void-" "-world" in
7 let hey = Eio.Path.load (fs / "./examples/hey") in
8 Eio.Path.save ~create:(`If_missing 0o755) (fs / temp_dir / "hey") hey;
9 temp_dir
10
11(* This mounts the hello-world into the void process. *)
12let () =
13 Eio_posix.run @@ fun env ->
14 Switch.run @@ fun sw ->
15 let hey_dir = copy_hey env#fs in
16 let void =
17 let open Void in
18 empty |> mount ~mode:R ~src:hey_dir ~tgt:"say" |> exec [ "/say/hey" ]
19 in
20 let t = Void.spawn ~sw void in
21 let status = Promise.await (Void.exit_status t) in
22 Eio.traceln "Void process: %s" (Void.exit_status_to_string status)