aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/doc/src/erlang.xml4
-rw-r--r--lib/dialyzer/test/small_SUITE_data/results/port_info_test2
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl1
3 files changed, 4 insertions, 3 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index 2fbfe6eb74..cfc7fff3af 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -3573,9 +3573,9 @@ os_prompt% </pre>
<p><c>Bytes</c> is the total number of bytes written to
the port.</p>
</item>
- <tag><c>{os_pid, Integer}</c></tag>
+ <tag><c>{os_pid, Integer | undefined}</c></tag>
<item>
- <p><c>Integer</c> is the OS pid of the spawned process (Unix systems only).</p>
+ <p><c>Integer</c> is the process identifier (or equivalent) of an OS process created with <c>open_port({spawn | spawn_executable, Command}, Options)</c>. If the port is not the result of spawning an OS process, the value is <c>undefined</c>.</p>
</item>
</taglist>
<p>Failure: <c>badarg</c> if <c>Port</c> is not a local port.</p>
diff --git a/lib/dialyzer/test/small_SUITE_data/results/port_info_test b/lib/dialyzer/test/small_SUITE_data/results/port_info_test
index 8a4ce0fc66..863a3d61df 100644
--- a/lib/dialyzer/test/small_SUITE_data/results/port_info_test
+++ b/lib/dialyzer/test/small_SUITE_data/results/port_info_test
@@ -4,4 +4,4 @@ port_info_test.erl:14: The pattern {'registered_name', "42"} can never match the
port_info_test.erl:19: The pattern {'output', 42} can never match the type 'undefined' | {'connected',pid()}
port_info_test.erl:24: Guard test 'links' =:= Atom::'connected' can never succeed
port_info_test.erl:28: The pattern {'gazonk', _} can never match the type 'undefined' | {'connected' | 'id' | 'input' | 'links' | 'name' | 'os_pid' | 'output' | 'registered_name',atom() | pid() | [pid() | char()] | integer()}
-port_info_test.erl:32: The pattern {'os_pid', "42"} can never match the type 'undefined' | {'os_pid',integer()}
+port_info_test.erl:32: The pattern {'os_pid', "42"} can never match the type 'undefined' | {'os_pid','undefined' | non_neg_integer()}
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index c443b911d6..5033cef8c5 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -1186,6 +1186,7 @@ type(erlang, port_info, 2, Xs) ->
['links'] -> t_tuple([Item, t_list(t_pid())]);
['name'] -> t_tuple([Item, t_string()]);
['output'] -> t_tuple([Item, t_integer()]);
+ ['os_pid'] -> t_tuple([Item, t_sup(t_non_neg_integer(),t_atom('undefined'))]);
['registered_name'] -> t_tuple([Item, t_atom()]);
List when is_list(List) ->
t_tuple([t_sup([t_atom(A) || A <- List]),