More.OsOperating system interaction.
module Path : sig ... endFile system path operations.
module File : sig ... endRegular file operations.
module Dir : sig ... endDirectory operations.
module Fd : sig ... endFile descriptors operations.
module Socket : sig ... endSocket operations.
module Env : sig ... endEnvironment variables.
module Cmd : sig ... endExecuting commands.
module Exit : sig ... endProgram exit.
val sleep : Mtime.Span.t -> Mtime.Span.tsleep 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.
relax sleeps for a very small duration. Can be used for relaxed busy waiting.
module Cpu : sig ... endCPU time and information.
module Mtime : sig ... endMonotonic time clock and sleep.
module Name : sig ... endOS names.
val name : ?id_like:bool -> unit -> Name.tname () is the name of the operating system running the process. If id_like is true returns a possible parent name instead (e.g. "debian" instead of "ubuntu"), defaults to false. This is determined, along with version as follows:
On POSIX environments it depends on the lowercased sysname field returned by uname(2):
"linux", the file /etc/os-release is consulted. The lowercased ID or first element of ID_LIKE if id_like is true determines id and Name.Linux id is returned. The field VERSION_ID is used to determine version. If the file can't be found id is sysname and version "unknown"."freebsd", behaves like the Linux case but Bsd id is returned."darwin", the file /System/Library/CoreServices/SystemVersion.plist is consulted. The lowercased ProductName key determines id and Name.Darwin id is returned. The ProductVersion key determines version. If the file can't be found id is sysname and version "unknown"."netbsd" and "openbsd" then Name.Bsd sysname is returned and version is "unknown"."cygwin_nt", then Name.Windows "cygwin" and version is determined like windows (see below).Other sysname and version is "unknown"Windows "windows" and version uses the the caml_win32_* variables of the OCaml runtime system to format a version numberName.Other "unknown" and version is "unknown"version () is a version string for the operating system. The format and determination depends on name, read there. If no version can be determined this is "unknown".
module Arch : sig ... endOS architectures.
val arch : unit -> Arch.tarch () is the architecture of the operating system running the process (it may differ from your CPU). It is determined by calling Arch.of_string with a string obtained as follows.
machine field returned by uname(2).GetNativeSystemInfo function and munges the wProcessorArchitecture field into a string."unknown".