package posix-uname

  1. Overview
  2. Docs
Bindings for posix uname

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v4.0.2.tar.gz
md5=2e05f3e890206138c4ebd09878359a2f
sha512=79a786c299b5d9f7f5ff0c3cf289539e8ea257b2068f75cd9faca9450679e5cd7de6b0fc5b77c9ddbbb5857d4f64119837a61a22d277e6e2a8ab4b3c4d5911c0

doc/posix-uname/Posix_uname/index.html

Module Posix_unameSource

POSIX system identification bindings.

This module provides OCaml bindings to the POSIX uname function defined in sys/utsname.h.

It allows retrieval of system identification information such as the operating system name, version, and hardware architecture.

Sourcetype utsname = {
  1. sysname : string;
    (*

    Operating system name (e.g., "Linux", "Darwin")

    *)
  2. nodename : string;
    (*

    Network node hostname

    *)
  3. release : string;
    (*

    Operating system release (e.g., "5.4.0")

    *)
  4. version : string;
    (*

    Operating system version

    *)
  5. machine : string;
    (*

    Hardware architecture (e.g., "x86_64", "arm64")

    *)
}

System identification information returned by uname.

This record corresponds to the POSIX struct utsname.

Sourceval uname : unit -> utsname

Return system identification information.

See uname(2).

  • returns

    A record containing system identification information.

Example:

  let info = uname () in
  Printf.printf "Running on %s %s (%s)\n" info.sysname info.release
    info.machine