What is it that makes an OS a POSIX system? All versions of Linux are POSIX, right? What about Mac OS X?
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.
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.
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.
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
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
_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
. –
Conformation © 2022 - 2024 — McMap. All rights reserved.
stat()
,read()
, etc. – Extravascular