[erlang-questions] Re: [erlang-questions 82] Re: code:lib_dir and .ez archives
Mon Mar 28 22:50:58 CEST 2011
Max Lapshin wrote:
>Maybe just add something like os:daemonize() ?
Uhh, "just"? Do you have some suggestions for the implementation? I
guess you're thinking of an analogue to the daemon(3) function that can
commonly be found in the C library on *nix. This function calls fork(2),
and subsequently the parent process exits, while execution continues in
the child (which returns from the daemon() call).
Obviously this can't be done in Erlang code, and while a (Unix-only, of
course) BIF that does exactly the same thing as daemon(3) wouldn't be
hard to implement per se, I wouldn't want to even begin to figure out
what effects it would have on the Erlang VM at some arbitrary point in
its execution. If it really is trivial to get it to work, you can "just"
write a NIF...
More information about the erlang-questions