<div dir="ltr"><div><div><div><div><div><div>There is more. So:<br><br>1> process_flag(trap_exit, true).<br>false<br>2> Pid = spawn_link(fun() -> process_flag(trap_exit,true), timer:sleep(infinity) end).<br><0.60.0><br><br></div>We trap exits and spawn_link which also traps exits and just hangs there waiting.<br><br>3> spawn(fun() -> link(Pid), exit(kill) end).<br><0.62.0><br>4> process_info(Pid, messages).<br>{messages,[{'EXIT',<0.62.0>,kill}]}<br><br></div>Now we spawn a new process which links to our hanger and exits with the reason 'kill'. We can then check our hanger and see that it received a 'kill' signal which it converted to a message because it was trapping. Finally:<br><br>5> spawn(fun() -> exit(Pid, kill) end).<br><0.65.0><br>6> flush().<br>Shell got {'EXIT',<0.60.0>,killed}<br>ok<br><br></div>we spawn another process which uses exit/2 to send a 'kill' signal to our hanger and in this case it cannot trap the signal and dies with the reason 'killed'. So there is 'kill' and 'kill' depending on how I send it.<br><br></div>Where's the logic in that?<br><br></div>Robert<br><br></div>P.S. Yes, I know that getting a 'killed' from a process which has been killed with a 'kill' signal is the correct.<br><br></div>