POSIX
By IEEE and The Open Group
POSIX (Portable Operating System Interface) is a family of IEEE standards that define a common interface for Unix-like operating systems, specifying system calls, command-line utilities, shell behavior, and C library functions so that…
Definition
POSIX (Portable Operating System Interface) is a family of IEEE standards that define a common interface for Unix-like operating systems, specifying system calls, command-line utilities, shell behavior, and C library functions so that software written to the standard can run across different compliant operating systems with minimal changes. It was created to bring order to the fragmentation among competing Unix variants in the 1980s. POSIX compliance today is a common baseline expectation for Linux, macOS, and other Unix-like systems.
Overview
POSIX emerged in the 1980s during a period often called the Unix wars, when AT&T's System V, Berkeley's BSD, and various vendor-specific Unix derivatives (from IBM, Sun, HP, DEC, and others) had each evolved their own incompatible extensions to core Unix behavior, making it difficult to write software, or even shell scripts, that would run correctly across different vendors' systems. The IEEE, working with input from vendors and users, standardized a common baseline, POSIX, so that software developers and system administrators could rely on a documented, portable interface rather than testing against every vendor's quirks individually. Mechanically, POSIX is not a single document but a family of related standards covering different layers of the system: the core system interface defines system calls like fork, exec, open, and read along with their exact expected behavior and error conditions; a separate part defines the required behavior of standard command-line utilities including their options and exact output format; and another part standardizes the shell language itself, defining the syntax and semantics that POSIX-compliant shells like sh must support. A conforming operating system implements these interfaces consistently, so a program written using only POSIX-specified system calls and library functions can be recompiled, without source changes, on any other POSIX-compliant system. POSIX sits above individual Unix-like operating systems as a specification they conform to, rather than being an operating system itself; Linux, macOS (through its Unix03 certification), Solaris, and the BSDs all implement POSIX to varying degrees, though few claim full official certification since that process is costly. Windows historically supported a POSIX subsystem for limited compatibility but is not natively POSIX-compliant, which is why Windows-specific tooling like WSL (Windows Subsystem for Linux) exists to bridge the gap for developers who need a POSIX environment. In practice, POSIX compliance matters most to developers writing portable systems software, shell scripts, and command-line tools that need to behave identically across Linux, macOS, and other Unix-like targets; adhering to POSIX-specified behavior rather than a particular shell's or OS's extensions is what makes a script reliably portable. Standards bodies and language runtimes, including POSIX Threads, build on the base POSIX specification to standardize additional subsystems like threading. The practical limitation is that strict POSIX compliance sometimes means giving up more convenient, but non-portable, extensions that a specific shell (like Bash) or operating system offers, so developers must choose between writing maximally portable POSIX-sh scripts or using richer, but less portable, shell- or OS-specific features, a trade-off that shows up constantly in build systems and cross-platform tooling.
Specification
- Standardizes core system calls like fork, exec, open, and read
- Defines required behavior for standard command-line utilities
- Specifies the syntax and semantics of the POSIX shell language
- Implemented to varying degrees by Linux, macOS, Solaris, and BSDs
- Enables source-level portability across compliant Unix-like systems
- Maintained jointly by IEEE and The Open Group
- Basis for further standards such as POSIX Threads