package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.kit/B0_os/index.html
Module B0_osSource
Operating system and machine information.
OS identification
name is the operating system name. Determined using the following steps, in order:
If the
unametool is available in the memo environment,nameis the lowercased token returned byuname -s, transformed as follows:"darwin"is mapped on"macos"- Otherwise left as is. XXX. Normalization is likely unsufficient.
- If the
COMSPECenvironment variable is defined in the memo environment,"windows". - Otherwise,
"unknown".
version is the operating system version string. This depends on the value of name:
"freebsd". The output ofuname -U."linux". An Android heuristic is applied, otherwise looks theVERSION_IDfield of os-release if available, otherwise"unknown""macos". The output ofsw_vers -productVersion."windows". The parsed output ofcmd.exe /c ver. The Windows operating system to which this version string maps can be found here.- Otherwise if the
unametool is available in the memo environment the result ofuname -rand otherwise"unknown".
distribution is the operating system distribution or a package manager. This depends on the value of name:
"linux". Looks up theIDfield of os-release if available, if not found"linux""macos". If either thebreworporttool is found in the memo environment then this is respectively"homebrew"or"macports". The former takes over if both are present. If none are found"macos".- Otherwise. The value of
name
family is the operating system family. This lumps the following name names under a common identifier:
- The various BSDs as
"bsd" "windows","cygwin"as"windows""linux", looks up the first value ofID_LIKEin os-release if available. If not usesdistribution.- Otherwise. The value of
name
Executable file extension
exe_ext is operating system specific file extension for executable files. This is:
".exe"ifnameis"windows".""otherwise.
Machine architecture
As reported by the operating system.
arch is the architecture of the operating system, see also arch_normalized. Determined using the following steps (in order):
- If
unameis available in the memo environment,archis the lowercased token returned byuname -m. - If the
PROCESSOR_ARCHITECTUREenvironment variable is defined in the memo environment, its value unless it is"x86". In the latter case the value ofPROCESSOR_ARCHITEW6432or, if undefined,"x86". This is for Windows, see here for the rationale. - Otherwise,
"unknown".
arch_normalized normalizes some of the arch values to more general identifiers like "arm32", "arm64", "ppc32", "ppc64", "x86_32" and "x86_64".
arch_bits is number of bits in a word on the architecture of the operating system, derived from arch_normalized. Usually either 32 or 64. If unknown warns on the memo and defaults to 64.