From d4667d383964c1550e0a91d64b674e84f6d07e3b Mon Sep 17 00:00:00 2001 From: Matthias Lang Date: Thu, 19 Aug 2010 15:12:26 +0200 Subject: Extend erlang:port_info/1,2 to show the OS pid of a spawned process When spawning OS (unix) processes with erlang:open_port, store the resulting unix pid so that it can be queried later on using erlang:port_info/1,2. --- lib/hipe/cerl/erl_bif_types.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/hipe/cerl/erl_bif_types.erl') diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 3d1e3e8137..7ddbf56dd4 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -780,6 +780,7 @@ type(erlang, port_info, 2, Xs) -> ['input'] -> t_tuple([Item, t_integer()]); ['links'] -> t_tuple([Item, t_list(t_pid())]); ['name'] -> t_tuple([Item, t_string()]); + ['os_pid'] -> t_tuple([Item, t_integer()]); ['output'] -> t_tuple([Item, t_integer()]); ['registered_name'] -> t_tuple([Item, t_atom()]); List when is_list(List) -> @@ -2282,7 +2283,7 @@ arg_types(erlang, port_info, 1) -> arg_types(erlang, port_info, 2) -> [t_sup(t_port(), t_atom()), t_atoms(['registered_name', 'id', 'connected', - 'links', 'name', 'input', 'output'])]; + 'links', 'name', 'input', 'output', 'os_pid'])]; %% Guard bif, needs to be here. arg_types(erlang, round, 1) -> [t_number()]; -- cgit v1.2.3