aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc/src/erlang.xml
diff options
context:
space:
mode:
Diffstat (limited to 'erts/doc/src/erlang.xml')
-rw-r--r--erts/doc/src/erlang.xml120
1 files changed, 116 insertions, 4 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 6932b18571..2183f75487 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -126,7 +126,7 @@
instance.</p>
<p>One can get an approximation of the <c>native</c>
time unit by calling
- <seealso marker="erlang:convert_time_unit/3">
+ <seealso marker="#convert_time_unit/3">
<c>erlang:convert_time_unit(1, second, native)</c></seealso>.
The result equals the number
of whole <c>native</c> time units per second. If
@@ -1269,6 +1269,42 @@ end</code>
data is available by calling
<seealso marker="erlang#dist_ctrl_get_data_notification/1"><c>erlang:dist_ctrl_get_data_notification(DHandle)</c></seealso>.
</p>
+ <p>The returned value when there are data available depends
+ on the value of the <c>get_size</c> option configured on the
+ distribution channel identified by <c><anno>DHandle</anno></c>.
+ For more information see the documentation of the <c>get_size</c>
+ option for the
+ <seealso marker="#dist_ctrl_set_opt/3"><c>erlang:dist_ctrl_set_opt/3</c></seealso>
+ function.</p>
+ <note><p>
+ Only the process registered as distribution
+ controller for the distribution channel identified by
+ <c><anno>DHandle</anno></c> is allowed to call this
+ function.
+ </p></note>
+ <p>
+ This function is used when implementing an alternative
+ distribution carrier using processes as distribution
+ controllers. <c><anno>DHandle</anno></c> is retrived
+ via the callback
+ <seealso marker="erts:alt_dist#hs_data_f_handshake_complete"><c>f_handshake_complete</c></seealso>.
+ More information can be found in the documentation of
+ <seealso marker="erts:alt_dist#distribution_module">ERTS
+ User's Guide ➜ How to implement an Alternative Carrier
+ for the Erlang Distribution ➜ Distribution Module</seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
+ <name name="dist_ctrl_get_opt" arity="2" clause_i="1" since="OTP 22.0"/>
+ <fsummary>Get value of the get_size option on a distribution channel</fsummary>
+ <desc>
+ <p>Returns the value of the <c>get_size</c> option on the distribution channel
+ identified by <c><anno>DHandle</anno></c>. For more information see the
+ documentation of the <c>get_size</c> option for the
+ <seealso marker="#dist_ctrl_set_opt/3"><c>erlang:dist_ctrl_set_opt/3</c></seealso>
+ function.</p>
<note><p>
Only the process registered as distribution
controller for the distribution channel identified by
@@ -1392,6 +1428,55 @@ end</code>
</func>
<func>
+ <name name="dist_ctrl_set_opt" arity="3" clause_i="1" since="OTP 22.0"/>
+ <fsummary>Set value of the get_size option on a distribution channel</fsummary>
+ <desc>
+ <p>Sets the value of the <c>get_size</c> option on the distribution channel
+ identified by <c><anno>DHandle</anno></c>. This option controls the return
+ value of calls to
+ <seealso marker="#dist_ctrl_get_data/1">erlang:dist_ctrl_get_data(<anno>DHandle</anno>)</seealso>
+ where <c><anno>DHandle</anno></c> equals <c><anno>DHandle</anno></c> used
+ when setting this option.
+ When the <c>get_size</c> option is:</p>
+ <taglist>
+ <tag><c>false</c></tag>
+ <item>
+ and there are distribution data available, a call to
+ <c>erlang:dist_ctrl_get_data(<anno>DHandle</anno>)</c>
+ will just return <c>Data</c> to pass over the channel.
+ This is the default value of the <c>get_size</c> option.
+ </item>
+ <tag><c>true</c></tag>
+ <item>
+ and there are distribution data available, a call to
+ <c>erlang:dist_ctrl_get_data(<anno>DHandle</anno>)</c>
+ will return <c>Data</c> to pass over the channel as well as
+ the <c>Size</c> of <c>Data</c> in bytes. This is returned as
+ a tuple on the form <c>{Size, Data}</c>.
+ </item>
+ </taglist>
+ <p>All options are set to default when a channel is closed.</p>
+ <note><p>
+ Only the process registered as distribution
+ controller for the distribution channel identified by
+ <c><anno>DHandle</anno></c> is allowed to call this
+ function.
+ </p></note>
+ <p>
+ This function is used when implementing an alternative
+ distribution carrier using processes as distribution
+ controllers. <c><anno>DHandle</anno></c> is retrived
+ via the callback
+ <seealso marker="erts:alt_dist#hs_data_f_handshake_complete"><c>f_handshake_complete</c></seealso>.
+ More information can be found in the documentation of
+ <seealso marker="erts:alt_dist#distribution_module">ERTS
+ User's Guide ➜ How to implement an Alternative Carrier
+ for the Erlang Distribution ➜ Distribution Module</seealso>.
+ </p>
+ </desc>
+ </func>
+
+ <func>
<name name="element" arity="2" since=""/>
<fsummary>Return the Nth element of a tuple.</fsummary>
<type_desc variable="N">1..tuple_size(<anno>Tuple</anno>)</type_desc>
@@ -1751,6 +1836,10 @@ true</pre>
<item>
<p><c>Pid</c> is the process identifier of the process
that originally created the fun.</p>
+ <p>It might point to the <c>init</c> process if the
+ <c>Fun</c> was statically allocated when module was
+ loaded (this optimisation is performed for local
+ functions that do not capture the enviornment).</p>
</item>
<tag><c>{index, Index}</c></tag>
<item>
@@ -2464,6 +2553,7 @@ os_prompt%</pre>
true
> is_map_key(value,Map).
false</code>
+ <p>Allowed in guard tests.</p>
</desc>
</func>
@@ -3016,6 +3106,7 @@ false</code>
Map = #{42 => value_two,1337 => "value one","a" => 1},
map_get(Key,Map).
"value one"</code>
+ <p>Allowed in guard tests.</p>
</desc>
</func>
@@ -4574,6 +4665,7 @@ RealSystem = system + MissedSystem</code>
<name name="port_info" arity="2" clause_i="6" since="OTP R16B"/>
<fsummary>Information about the memory size of a port.</fsummary>
<desc>
+ <marker id="port_info_memory"/>
<p><c><anno>Bytes</anno></c> is the total number of
bytes allocated for this port by the runtime system. The
port itself can have allocated memory that is not
@@ -5206,11 +5298,13 @@ RealSystem = system + MissedSystem</code>
changed or removed without prior notice.</p>
</item>
<tag><c>{current_function, {<anno>Module</anno>,
- <anno>Function</anno>, Arity}}</c></tag>
+ <anno>Function</anno>, Arity} | undefined}</c></tag>
<item>
<p><c><anno>Module</anno></c>, <c><anno>Function</anno></c>,
<c><anno>Arity</anno></c> is
- the current function call of the process.</p>
+ the current function call of the process. The value
+ <c>undefined</c> can be returned if the process is
+ currently executing native compiled code.</p>
</item>
<tag><c>{current_location, {<anno>Module</anno>,
<anno>Function</anno>, <anno>Arity</anno>,
@@ -5296,6 +5390,7 @@ RealSystem = system + MissedSystem</code>
</item>
<tag><c>{memory, <anno>Size</anno>}</c></tag>
<item>
+ <marker id="process_info_memory"/>
<p><c><anno>Size</anno></c> is the size in bytes of the process.
This includes call stack, heap, and internal structures.</p>
</item>
@@ -6585,7 +6680,7 @@ lists:map(
<tag><c>async</c></tag>
<item>Async threads are used by various linked-in drivers (mainly the
file drivers) do offload non-CPU intensive work. See
- <seealso marker="erts:erl#+async_thread_pool_size">erl +A</seealso> for more details.</item>
+ <seealso marker="erts:erl#async_thread_pool_size">erl +A</seealso> for more details.</item>
<tag><c>aux</c></tag>
<item>Takes care of any work that is not
specifically assigned to a scheduler.</item>
@@ -9319,6 +9414,18 @@ Metadata = #{ pid => pid(),
<p>Returns the previous system monitor settings just like
<seealso marker="#system_monitor/0">
<c>erlang:system_monitor/0</c></seealso>.</p>
+ <p>The arguments to <c>system_monitor/2</c> specifies how all
+ system monitoring on the node should be done, not how it should be
+ changed. This means only one process at a time
+ (<c><anno>MonitorPid</anno></c>) can be the receiver of system monitor
+ messages. Also, the way to clear a specific monitor option
+ is to not include it in the list <c><anno>Options</anno></c>. All
+ system monitoring will, however, be cleared if the process identified by
+ <c><anno>MonitorPid</anno></c> terminates.</p>
+ <p>There are no special option values (like zero) to clear an option.
+ Some of the options have a unspecified minimum value. Lower values
+ will be adjusted to the minimum value. For example, it is currently not
+ possible to monitor all garbage collections with <c>{long_gc, 0}</c>.</p>
<note>
<p>If a monitoring process gets so large that it itself
starts to cause system monitor messages when garbage
@@ -10023,6 +10130,11 @@ timestamp() ->
time stamp flags are remembered, so if two are passed
and the one with highest precedence later is disabled,
the other one becomes active.</p>
+ <p>If a match specification (applicable only for <c>call</c>, <c>send</c>
+ and <c>'receive'</c> tracing) contains a <c>{message}</c> action
+ function with a non-boolean value, that value is added as an extra
+ element to the message tuple either in the last position or before
+ the timestamp (if it is present).</p>
<p>Trace messages:</p>
<marker id="trace_3_trace_messages"></marker>
<taglist>