You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are multiple domains running, in the child process created by fork there is only one domain running and the OCaml runtime system is in an inconsistent state. So, the child cannot run OCaml code, and that's why Unix.fork must fail in multi-domain programs.
However, the child process can still run C code, esp. if the C code does little more than calling exec, as in the case for the system C standard library function.
Plus, this man page is misleading: system can also be implemented with posix_spawn, which in turn may not involve a full fork.
The explict call to
fork
is guarded here: fork.c#L28:But in runtime/sys.c:L497 there is a call to
int system(const char *command)
whose manpage says:Should this one also
failwith
?The text was updated successfully, but these errors were encountered: