Files
linuxkit/projects/miragesdk/src/fdd/common.mli
Thomas Gazagnaire 56229e486b sdk: add a file-descriptor sharing server
```
$ fdd init &
$ fdd share /tmp/foo # serve a fresh socketpair on that path
$ fdd test /tmp/foo  # read the socketpair and test that it works
```

Instead of `fdd test` (which is only useful for testing), users are expected to
connect to the unix domain socket and call `recvmsg(2)`. They will get one side
of the socketpair. Two different processes can do this and they will be able to
talk to each other.

Signed-off-by: Thomas Gazagnaire <thomas@gazagnaire.org>
2017-06-29 17:53:49 +02:00

5 lines
235 B
OCaml

val bind: string -> Lwt_unix.file_descr Lwt.t
val connect: string -> Lwt_unix.file_descr Lwt.t
val send_fd: to_send:Lwt_unix.file_descr -> Lwt_unix.file_descr -> unit Lwt.t
val recv_fd: Lwt_unix.file_descr -> Lwt_unix.file_descr Lwt.t