What is it that makes an OS a POSIX system? All versions of Linux are POSIX, right? What about Mac OS X?
5 Answers
Is Mac OS X a POSIX OS?
Yes.
POSIX is a group of standards that determine a portable API for Unix-like operating systems. Mac OS X is Unix-based (and has been certified as such), and in accordance with this is POSIX compliant. POSIX guarantees that certain system calls will be available.
Essentially, Mac satisfies the API required to be POSIX compliant, which makes it a POSIX OS.
All versions of Linux are not POSIX-compliant. Kernel versions prior to 2.6 were not compliant, and today Linux isn't officially POSIX-compliant because they haven't gone out of their way to get certified (which will likely never happen). Regardless, Linux can be treated as a POSIX system for almost all intents and purposes.

- 16,038
- 10
- 74
- 104

- 75,757
- 21
- 156
- 151
-
1@z-buffer you can rely on certain system calls to be available, e.g. `stat()`, `read()`, etc. – Rafe Kettler Apr 26 '11 at 03:18
-
There are many versions of Linux systems. Is it because of Linux that POSIX was created? – node ninja Apr 26 '11 at 03:39
-
1"All versions are not" here means "No versions are" — rather than "Not all versions are" or "Some versions are". Right? – tchrist Apr 26 '11 at 03:49
-
@tchrist Linux is not truly POSIX compliant because they're not certified, and they never have been. So the existing wording is most correct. – Rafe Kettler Apr 26 '11 at 03:53
-
@Rafe: That’s what I thought. I was just making sure, is all. – tchrist Apr 26 '11 at 03:54
-
@tchrist no problem. Wording is important. – Rafe Kettler Apr 26 '11 at 03:55
-
4@z-buffer: "Is it because of Linux that POSIX was created?" No. First POSIX standard 1988. Mr. Torvalds begins developement of Linux, 1991. http://en.wikipedia.org/wiki/Posix#Name http://en.wikipedia.org/wiki/Linux#History. As I remember, POSIX grew out of need to write portable Unix apps across AT&T Unix, BSD Unix, etc. – Shannon Severance Apr 26 '11 at 22:07
-
14Important related fact: Mac uses the BSD implementation of the POSIX utils, not the GNU one like Linux does. – Ciro Santilli OurBigBook.com Feb 16 '14 at 14:33
-
4Please note that OSX POSIX implementation is old, so newer POSIX software might not compile. – LtWorf Sep 17 '14 at 08:58
-
2@CiroSantilli巴拿馬文件六四事件法轮功 What are the differences between GNU and BSD utils? If I'm understanding correctly, POSIX states an OS must have certain utilities, and then the OS implements it. OSX uses BSD implementations and some linux distros use the GNU implementations? Are these **utilities** system calls, because I thought system calls were part of the kernel – Honinbo Shusaku May 31 '16 at 16:52
-
@Abdul system calls are part of the kernel, and in Linux they only have an assembly official interface, not C. POSIX does not specify any assembly interface, only C, so POSIX does not specify anything about the Linux kernel itself. In practice however, if the OS is not made to support POSIX, it is hard to do it efficiently. GNU glibc implements the POSIX C API, often by wrapping kernel assembly system calls into C. I don't know anything about BSD, but I imagine that the situation is similar. – Ciro Santilli OurBigBook.com May 31 '16 at 17:36
-
For all intents and purposes, for most developers, both UNIX and POSIX is equal to Linux. Technically this definitely isn't true though, and both officially and in practice, Linux is neither a UNIX nor POSIX. – Clearer Dec 08 '17 at 10:31
-
@RafeKettler, Re "to be available"; Just available? – Pacerier Mar 06 '18 at 10:12
Yes, OS X is based on Darwin BSD, and since 10.5 (Leopard - 18-May-2007) all Intel/AMD versions have been officially certified as compliant with the Unix 03 / POSIX standard eg.

- 1,969
- 18
- 31
No, it is not. MacOS is missing a whole bunch of features of POSIX, like clock_nanosleep()
. It might be compliant with a subset of POSIX or with a really really old version of POSIX, but it's definitely not compliant with POSIX.1-2017. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html.

- 159
- 2
- 4
-
I have also found a non-compliance bug in OS/X. Signals are supposed to be delivered to the first thread that either un-masks the signal or calls sigwait on the signal. In OS/X, when a signal is sent to a process and it was masked in all threads, the signal is effectively pre-assigned to one thread -- sigpending() shows it present in only one thread! (sigpending is supposed to show the same result in every thread). If the unassigned thread then un-masks, nothing happens. If sigwait is called by the unassigned thread, it succeeds, so it gets this one thing right. – user1843703 May 02 '20 at 13:15
OSX POSIX
Single UNIX Specification(SUS)
. It is a set of standards to use UNIX
mark.
Portable Operating System Interface(POSIX)
- it is a subset of SUS
. It defines API between OS and application as long as others tools and utilities. It includes such parts as Process, IO, Threads, security, Shell
UNIX 03
is a Product Standard mark which conforms SUS v3
Latest Apple Inc UNIX products
MAC OS(since 10.5 Leopard) is a UNIX 03
compliant OS which is certified by The Open Group.
Linux
is a general name of a core for others operating system.
Linux is not POSIX-certified(except some of them like Huawei EulerOS - UNIX 03). But Linux is mostly POSIX-compliant because they try to stick to these standards and even more

- 29,217
- 8
- 193
- 205
POSIX is a specification: http://www.unix.org/what_is_unix/single_unix_specification.html AFAIK, Linux adheres to the spec, but hasn't certified yet

- 6,511
- 7
- 46
- 73
-
3There are some funny issues - for instance it is not enough for a program that tries to adhere to POSIX to merely specify `_POSIX_C_SOURCE` with a value of say `200809L` to have the environment comply - I for one had trouble with the supposed GCC extension being the `realpath` function, which **is** specified by POSIX - unless I also specified a non-standard `_XOPEN_SOURCE` with a value of `700` the program had issues compiling. Not a biggie (the presence of the latter flag is no showstop for POSIX, but it is far less portable), but definitely a nag. See `man 2 realpath`. – Armen Michaeli Nov 16 '13 at 15:24