package mirage

  1. Overview
  2. Docs
The MirageOS library operating system

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mirage-4.10.4.tbz
sha256=f5eb059835524fe165f487d15d790c33c56b2fcdd08fa475cd41e5b051f9b47e
sha512=56256cf7d0b0647a223a78c90593f9a172f5a9f438123b633c47b47b95a2ec709111bd718d9ffa077aa1da8578671215cd8b80f2c79b70173b5cf277ad5a663a

doc/src/mirage.devices/misc.ml.html

Source file misc.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let get_target i = Key.(get (Functoria.Info.context i) target)

let connect_err name number =
  let str =
    Fmt.str "The %s connect expects exactly %d argument%s" name number
      (if number = 1 then "" else "s")
  in
  failwith str

let terminal () =
  let dumb = try Sys.getenv "TERM" = "dumb" with Not_found -> true in
  let isatty =
    try Unix.(isatty (descr_of_out_channel Stdlib.stdout))
    with Unix.Unix_error _ -> false
  in
  (not dumb) && isatty