4 ms·
OS X is posix-compliant. It doesn't implement certain GNUisms but depending on any vendor-specific problems is going to be a pain point.
by Sanddancer 10y ago
OS X is posix-compliant. It doesn't implement certain GNUisms but depending on any vendor-specific problems is going to be a pain point.
- Rooster61 10y agoSo it is. I was under the impression that its microkernel approach, specifically the system calls directed to Mach, caused it to deviate from the standard. You learn something new every day.
- pcwalton 10y agoDarwin is very much not POSIX-compliant. It may aim to be, but there are so many blatant unfixed bugs (broken poll, broken cmsg, etc.) and missing features (ptrace, etc.) that porting work is frequently necessary.
- TickleSteve 10y agoYes, it is POSIX compliant. Its also an official UNIX. http://stackoverflow.com/questions/5785516/is-osx-a-posix-os http://stackoverflow.com/questions/5785516/is-osx-a-posix-os https://en.wikipedia.org/wiki/Single_UNIX_Specification https://en.wikipedia.org/wiki/Single_UNIX_Specification Presence of bugs does not preclude you from being compliant to the spec. ...also... Linux is not officially compliant to either one.
- pcwalton 10y agoWhether I have to do porting work in practice (which I do, a lot) matters a lot more than what a consortium from 1996 says. The fact is, Darwin gives me trouble a lot more than Linux does when using POSIX APIs. If there were a comprehensive, up to date POSIX test suite, Darwin would fail it.
- pjmlp 10y agoBasically just like any other UNIX during the golden days of UNIX wars.
- wahern 10y agoOS X is UNIX 03 certified. That's a formalism. 1) That's a nearly 15-year-old standard (03 == 2003). Windows was certified to the predecessor POSIX standard. 2) While certified, it's compliance in actuality is poor. macOS's certified status says more about flaws in the certification test suite and administrative process, and the OpenGroup's need for income, than it does about macOS. The manual page for pselect, for example, even admits that it's not compliant! FreeBSD, Linux, NetBSD, OpenBSD and probably DragonflyBSD are all more compliant in a practical sense than macOS, and much more compliant to the latest specification as they implement all or most of the newly defined interfaces, while macOS implements very few. That said, yeah, macOS is compliant enough as a practical matter, especially compared to Windows. Porting stuff to macOS is about as painful as porting to Solaris or AIX, which is to say not very painful. The biggest headaches with macOS are the bugs. For example, last week I was adding support for sendmsg/recvmsg and IP_PKTINFO in my Lua unix module and was able to reliably crash the kernel with a single line of unprivileged code: https://www.irif.fr/~boutier/mac-crash.html I was really confused at first. I had to reboot multiple times before I figured out it was my test code and not my hardware dying. After some Googling I found the above link that verified what I was seeing. This bug was only fixed, AFAIK, in macOS 10.12. (I don't have a 10.11 machine to test.) I was testing the code on 10.10, and as of the latest update a couple of days ago 10.10 is still broken AFAIK. The most famous problem was kqueue not supporting pipes, but that was fixed eons ago. There are alot of other problems with their neworking subsystem, though. For example, shutdown() fails if the associated stream has already entered the equivalent state, either because the sender sent RSET/FIN or shutdown was alreayd called; no other implementation does that. If you send a socket descriptor to another process with sendmsg and then immediately exit the process, the receiving process will receive an unuseable file descriptor. There are lots of stupid quirks like this that make writing reliable, high-availability software for macOS very difficult. Fortunately, few people use macOS for HA server stuff, but I like porting my software to other platforms because it helps catch bugs (bugs that, for w'eve reason, stay hidden when running on Linux), and macOS provides a poor signal/noise ratio in that regard.
- RJIb8RBYxzAMX9u 10y ago> [...] The manual page for pselect, for example, even admits that it's not compliant! Where does it say that? I'm running 10.12.1, and the man page for pselect(2) looks like the one from FreeBSD. I could believe that pselect doesn't actually behave as documented, having run into my share of macOS bugs. > [...] Porting stuff to macOS is about as painful as porting to Solaris or AIX, which is to say not very painful [...] The biggest headaches with macOS are the bugs. Agreed, though AFAIK all commercial UNIXes are buggy in one way or another, and I don't know if macOS is worse in comparison. Autoconf exists for a reason, even though few if any really like it.