On Wed, Oct 3, 2012 at 01:05:54PM -0300, Alvaro Herrera wrote:
> See the CAVEATS here:
>
> https://developer.apple.com/library/mac/#documentation/Darwin/Referenc
> e/ManPages/man2/fork.2.html
>
> Apparently fork() without exec() isn't all that well supported.
>
> Noticed while perusing http://lwn.net/Articles/518306/
I think this comment is more relevant:
Ah, OK, I found this
https://developer.apple.com/library/mac/#documentation/Da...
It seems that from 10.5 this caveat was added to the official OS
X documentation. In that light I think it's safest to conclude
that Apple realised fork() is hard (check out the long list
of things a current Linux fork does to retain sanity in the
face of threads, asynchronous I/O, capabilities and other fun
toys that didn't exist at the dawn of Unix) and decided they
don't care. It will probably work, but if it doesn't they aren't
interested in explaining why/ fixing the problem.
On balance I agree this makes OS X a pretty shoddy Unix, but
then, I would have been easily persuaded of that anyway.
I am hesitant to avoid fork() on OS/X until someone reports a problem;
the slowdown would be significant, and I don't think we use enough OS/X
libraries to cause a problem for us, though Bonjour might be a problem.
Anyway, good you asked and we should be aware of possible problems.
--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +