3 ms·
> So POSIX support is a given on most systems. Why replace it with something that breaks existing code? POSIX is a lowest common denominator API, its under spe
by StillBored 9y ago
> So POSIX support is a given on most systems. Why replace it with something that breaks existing code?
POSIX is a lowest common denominator API, its under specified and loosely interpreted. Which follows from its initial goals, which was basically to specify the bits common between various UNIX implementations. Those implementations obviously didn't want to change their implementation to match a rigid standard, so a lot of wiggle room exists in the standard.
The end result is that is pretty much useless for anything beyond "hello world" kinds of applications, both in terms of portability, as well as actual behavior (I could list a lot of cases, but lets leave that to google, with the starting idea to look at a couple posix API's, say close()'s errno's and the differing cases and what causes them on different OS's/filesystems). That is why there isn't a single OS out there that is _ONLY_ POSIX compliant. You need look no further than the 15 year old https://personal.opengroup.org/~ajosey/tr28-07-2003.txt https://personal.opengroup.org/~ajosey/tr28-07-2003.txt and consider that the gap has widened as more performance or security oriented core API's have been introduced and linux's POSIX layer is further refined upon them.
Plus, the core API's in no way reflect the hard reality of modern hardware, leaving the standard even more under specified in the case of threads and async IO, which have been poorly bolted on.
Then there are all the bits everyone ignores, like the bits about the posix shell (ksh), and how certain utilities behave, while completely ignoring important things like determining metadata about the hardware one is running on.
I leave you with:
https://stackoverflow.com/questions/2693948/how-do-i-retrieve-the-number-of-processors-on-c-linux https://stackoverflow.com/questions/2693948/how-do-i-retriev...
and
https://stackoverflow.com/questions/150355/programmatically-find-the-number-of-cores-on-a-machine https://stackoverflow.com/questions/150355/programmatically-...
Which is pretty basic information about a modern machine.
- pjmlp 9y ago> POSIX is a lowest common denominator API,... Only useful for CLI tty old style apps and daemons.