Posted Nov 23, 2012 11:38 UTC (Fri) by man_ls (subscriber, #15091)
[Link]
Apparently there are many hidden ironies in this POSIX business, not just one.
POSIX compliance
Posted Nov 23, 2012 13:32 UTC (Fri) by Cyberax (✭ supporter ✭, #52523)
[Link]
You CAN use fork(2) in OS X. You just can't use fork _and_ Cocoa GUI at the same time.
That's not different from Linux and X11.
POSIX compliance
Posted Nov 23, 2012 14:25 UTC (Fri) by njs (guest, #40338)
[Link]
The difference is that (1) it's officially unsupported to use *any* Apple-written library that is not part of POSIX in a program which also uses fork, (2) since Apple considers this NOTABUG, the APIs provide no way to work around the problems.
With X11, using fork is fine -- you just have to make sure that you only use that connection in one of the children. The bug report I linked to is Apple explaining that you cannot use their *linear algebra library* (which implements the standard, cross-platform BLAS interfaces) on both sides of a fork, and that the only solution is to use a different linear algebra library.
[NB I don't use OS X or really care about it either way, except that these things are annoying to work around.]
POSIX compliance
Posted Nov 23, 2012 14:35 UTC (Fri) by Cyberax (✭ supporter ✭, #52523)
[Link]
Apple is just conservative. It's easier to say "it doesn't work" then to deal with developers using something that works only accidentally.
In particular, important parts of OS X are fork-safe. Moreover, OS X has support for code confinement and process isolation.