fork download
  1. -module(prog).
  2. -export([main/0]).
  3.  
  4. main() ->
  5. process_flag(trap_exit, true),
  6.  
  7. Pid1 = spawn(erlang, exit, [wtf]),
  8. link(Pid1),
  9. receive
  10. Msg ->
  11. Msg
  12. end,
  13.  
  14. Pid2 = spawn_link(erlang, exit, [wtf]),
  15. receive
  16. Msg2 ->
  17. Msg2
  18. end,
  19. {Msg, Msg2}.
  20.  
Success #stdin #stdout 0.05s 1749504KB
stdin
Standard input is empty
stdout
Standard output is empty