Module B0_std.Os

Operating system interaction.

File system

module Path : sig ... end

File system path operations.

module File : sig ... end

Regular file operations.

module Dir : sig ... end

Directory operations.

File descriptors and sockets

module Fd : sig ... end

File descriptors operations.

module Socket : sig ... end

Socket operations.

Processes

module Env : sig ... end

Environment variables.

module Cmd : sig ... end

Executing commands.

module Exit : sig ... end

Program exit.

Sleeping and timing

val sleep : Mtime.Span.t -> Mtime.Span.t

sleep dur sleeps for duration dur and returns the duration slept. The latter may be smaller than dur if the call was interrupted by a signal. This becomes imprecise if dur is greater than ~104 days.

val relax : unit -> unit

relax sleeps for a very small duration. Can be used for relaxed busy waiting.

module Cpu : sig ... end

CPU time and information.

module Mtime : sig ... end

Monotonic time clock and sleep.

OS architecture

module Arch : sig ... end

OS architectures.

val arch : unit -> Arch.t

arch is the architecture of the operating system (which may differ from your CPU). It is determined by calling Arch.of_string with a string obtained as follows:

  • On POSIX environments it uses the machine field returned by uname(2).
  • On Windows it uses the GetNativeSystemInfo function and munges the wProcessorArchitecture field into a string.
  • Otherwise it uses "unknown".

TODO. UNAME_MACHINE env override like uname on macos ?

Bazaar

val exn_don't_catch : exn -> bool

exn_don't_cath exn is true iff exn is Stack_overflow, Out_of_memory or Sys.Break.

FIXME find a place for that.