Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- is_shell(Pid) ->
- %% The shell never belongs to any applicition. To optimize, check
- %% that application:get_application(Pid) yields undefined before
- %% calling this function.
- {group_leader, Leader} = erlang:process_info(Pid, group_leadner),
- case lists:keyfind(shell, 1, group:interfaces(Leader)) of
- {shell, Shell} ->
- case Shell =:= Pid of
- true -> true;
- false ->
- case erlang:process_info(Shell, dictionary) of
- {dictionary, Dict} ->
- proplists:get_value(evaluator, Dict) =:= Pid
- end
- end
- end.
Add Comment
Please, Sign In to add comment