<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 19, 2015 at 11:01 AM, Adam Kövári <span dir="ltr"><<a href="mailto:kovariadam@gmail.com" target="_blank">kovariadam@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hello<br>
<br>
I noticed erlang:process_info(<PID of a global process>, registered_name) returns []. Is this expected? What is the reason this doesn’t work for globally registered processes?</blockquote><div><br></div><div>The process_info call returns local process information. The global process support is entirely separate.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> Is there a built in function which would work with global processes?<br>
<br>
<br>
Example:<br>
<br>
6> global:registered_names().<br>
[test_dumb1,...]<br>
7><br>
7> Pid = global:whereis_name(test_dumb1).<br>
<0.306.0><br>
8> erlang:process_info(Pid, registered_name).<br>
[]<br></blockquote><div><br></div><div>I don't see an API function for what you want, but here's a hack to get it:</div><div><br></div><div>9> ets:lookup(global_pid_names, Pid).</div><div>[{<0.306.0>,test_dumb1}]</div><div><br></div><div>But this reaches into the internals of the global module and so isn't the best thing to do. Perhaps the global module needs a new lookup-by-pid or process_info exported function. Or then again, maybe there's a good reason it's not provided.</div><div><br></div><div>--steve<br></div></div></div></div>