Skip to content

Commit

Permalink
Update changelog and docs with new erlang:system_info keys
Browse files Browse the repository at this point in the history
Adds edoc and "Programmers Guide" documentation for `os_type` and `os_version`
keys that have been added to `erlang:system_info/1`, and adds entry to
CHANGELOG.md

Signed-off-by: Winford <[email protected]>
  • Loading branch information
UncleGrumpy committed Apr 25, 2024
1 parent 7aeaa51 commit c215c13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Support for DragonFly BSD (generic_unix platform).
- Added support for `erlang:system_info/1` keys `os_type` and `os_version`.

### Fixed

Expand All @@ -21,9 +22,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added experimental optimized GC mode that makes use of C realloc instead of copying data around,
it can be enabled with `-DENABLE_REALLOC_GC=On`.
- ESP32: new keys for `erlang:system_info/1` to retrieve esp-idf semantic version info:
* `esp_idf_semantic` returns a tuple `{Major :: integer(), Minor :: integer(), Patch :: integer()}`
* `esp_idf_major`, `esp_idf_minor`, `esp_idf_patch` return individual integers

### Fixed

Expand Down
6 changes: 2 additions & 4 deletions doc/src/programmers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,8 @@ For more information about Erlang external term format, consult the [Erlang Docu

You can obtain system information about the AtomVM virtual machine via the [`erlang:system_info/1`](./apidocs/erlang/estdlib/erlang.md#system_info1) function, which takes an atom parameter designating the desired datum. Allowable parameters include

* `os_type` The operating system or runtime environment.
* `os_version` The sematic version of the currently running operating system or runtime environment.
* `process_count` The number of processes running in the system.
* `port_count` The number of ports running in the system.
* `atom_count` The number of atoms allocated in the system.
Expand Down Expand Up @@ -1067,10 +1069,6 @@ You can request ESP32-specific information using using the following input atoms
* `esp_get_minimum_free_size` Returns the smallest ever free space available in the ESP32 heap since boot, this will tell you how close you have come to running out of free memory.
* `esp_chip_info` Returns map of the form `#{features := Features, cores := Cores, revision := Revision, model := Model}`, where `Features` is a list of features enabled in the chip, from among the following atoms: `[emb_flash, bgn, ble, bt]`; `Cores` is the number of CPU cores on the chip; `Revision` is the chip version; and `Model` is one of the following atoms: `esp32`, `esp32_s2`, `esp32_s3`, `esp32_c3`.
* `esp_idf_version` Return the IDF SDK version, as a string.
* `esp_idf_semantic` Returns a tuple containing `{Major :: integer(), Minor :: integer(), Patch :: integer()}`.
* `esp_idf_major` Returns the major version number as an integer.
* `esp_idf_minor` Returns the minor version number as an integer.
* `esp_idf_patch` Returns the patch version number as an integer.
For example,
Expand Down
2 changes: 2 additions & 0 deletions libs/estdlib/src/erlang.erl
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ process_info(_Pid, _Key) ->
%%
%% The following keys are supported on all platforms:
%% <ul>
%% <li><b>os_type</b> tuple containing `{Osfamily :: atom(), Osname (or IDE) :: atom()}'</li>
%% <li><b>os_version</b> operating system sematic version `{Major :: integer(), Minor :: integer(), Patch :: integer()}'</li>
%% <li><b>process_count</b> the number of processes running in the node (integer)</li>
%% <li><b>port_count</b> the number of ports running in the node (integer)</li>
%% <li><b>atom_count</b> the number of atoms currently allocated (integer)</li>
Expand Down

0 comments on commit c215c13

Please sign in to comment.