[erlang-questions] Using 'monitor' with spawn_opt/3 throws badarg. Documentation bug?

Roger Lipscombe roger@REDACTED
Mon Feb 23 16:17:41 CET 2015


I'm attempting to use spawn_opt/3 with a remote node, like this:

    Fun = fun() -> ok end,
    {Pid, Ref} = spawn_opt(Node, Fun, [link, monitor]).

It fails with:

    {badarg,
      [{erlang,spawn_opt,
       ['imp_server@REDACTED',erlang,apply,
        [#Fun<erl_eval.20.80484245>,[]],
        [link,monitor]],
       []}

Now, the documentation at
http://www.erlang.org/doc/man/erlang.html#spawn_opt-5 says that the
'monitor' option is not allowed for spawn_opt/5. It says nothing about
spawn_opt/3.

Looking at the error message, it looks like spawn_opt/3 simply calls
spawn_opt/5. Does this note about 'monitor' being unsupported need to
be in documentation for both functions?



More information about the erlang-questions mailing list