ThePortable Operating System Interface (POSIX;IPA:/ˈpɒz.ɪks/[1]) is a family ofstandards specified by theIEEE Computer Society for maintaining compatibility betweenoperating systems.[1] In order to define a level of compatibility, POSIX specifies many aspects of functionality that can be classified asapplication programming interface (API),command-line shell, andshell commands. Originally derived from commonly-found Unix APIs, shells, and commands (partly because Unix was considered manufacturer-neutral), today many systems conform to the standard – includingbranded Unix systems,Unix-like systems, and many systems that were historically unrelated to Unix.[1][2]
The standardized user command line andscripting interface were based on theUNIX System VBourne shell.[3] Many user-level programs, services, and utilities (includingawk,echo,ed) were also standardized, based on UNIX System V versions of them, along with required program-level services (including basicI/O:file,terminal, andnetwork). POSIX also defines a standardthreading library API which is supported by most modern operating systems.
The standards emerged from a project that began in 1984 building on work from related activity in the/usr/group association.[5]Richard Stallman suggested the namePOSIX to the IEEE[6][7] instead of the formerIEEE-IX.[8] The committee found it more easily pronounceable and memorable, and thus adopted it.[citation needed]
Originally, POSIX referred to IEEE Std 1003.1-1988, released in 1988. The family of POSIX standards is formally designated asIEEE 1003 and the ISO/IEC standard number isISO/IEC 9945.
POSIX originally consisted of a single document for core services but over time additional documents were published to extend and revise the specification. Before 1997, POSIX comprised multiple documents that were published over the course of several years. After 1997, theAustin Group produces specifications titledSingle UNIX Specification (SUS). Over time, the group publishes versions of this specification and later POSIX is amended per some or all of a SUS version. A SUS version consists of a collection of volumes – each for a grouping of required behavior – plus other information (outside of a volume).[9] Each volume is assigned an issue number that is the same for each volume of a version, but is not the same value as the version. For example, SUS version 3 (SUSv3) includes volumes labeled issue 6.
As of 2014[update], POSIX documentation is divided into two parts:
POSIX.1, 2013 Edition: POSIX Base Definitions, System Interfaces, and Commands and Utilities (which include POSIX.1, extensions for POSIX.1, Real-time Services, Threads Interface, Real-time Extensions, Security Interface, Network File Access and Network Process-to-Process Communications, User Portability Extensions, Corrections and Extensions, Protection and Control Utilities and Batch System Utilities. This is POSIX 1003.1-2008 with Technical Corrigendum 1.)
POSIX Conformance Testing: A test suite for POSIX accompanies the standard:VSX-PCTS or theVSX POSIX Conformance Test Suite.[10]
POSIX.1-2001 (IEEE Std 1003.1-2001) consists of most of SUSv3 which consists of volumes (issue 6):Base Definitions,System Interfaces and Headers, andCommands and Utilities. The POSIX specification specifically excludes the SUSv3 requirements for a curses API (often calledX/Open Curses, even though there is no distinct grouping of this in SUSv3).[12]
IEEE Std 1003.1-2004 modifies POSIX.1-2001 via two minor updates orerrata referred to as technical corrigenda documents.[13][14]
Similar to its predecessor, POSIX.1-2008 (IEEE Std 1003.1-2008, 2016 Edition) consists of most of the normative material of SUSv4 (issue 7 of volumesBase Definitions,System Interfaces and Headers,Commands and Utilities).[15] SUSv4 also includes rationale information that largely applies to POSIX although not included per se.
POSIX mandates 512-byte defaultblock sizes for thedf anddu utilities, reflecting the typical size of blocks on disks. WhenRichard Stallman and theGNU team were implementing POSIX for theGNU operating system, they objected to this on the grounds that most people think in terms of 1024 byte (or 1KiB) blocks. The environment variablePOSIX_ME_HARDER was introduced to allow the user to force the standards-compliant behaviour.[18] The variable name was later changed toPOSIXLY_CORRECT.[19] As of 2025, this variable is also used for a number of other behaviour quirks.[20][21][22][23][24][25][26][27][28]
Current versions of the following operating systems have been certified to conform to one or more of the various POSIX standards. This means that they passed the automated conformance tests[29] and their certification has not expired and the operating system has not been discontinued.[30][31]
Some versions of the following operating systems had been certified to conform to one or more of the various POSIX standards. This means that they passed the automated conformance tests. The certification has expired and some of the operating systems have been discontinued.[30]
The following operating systems are not certified as POSIX conformant, but they conform in large part to the standard by implementing POSIX support via a compatibility feature (usually translation libraries, or a layer atop the kernel).
Some technologies allow an operating system to enjoy a level of conformance to POSIX even though the operating system itself has little or no conformance.
Afork of Cygwin, provides a less POSIX-compliant development environment and supports compatibleC-programmed applications viaMsvcrt, Microsoft's old Visual Cruntime library.
libunistd
A largely POSIX-compliant development library originally created to build the Linux-based C/C++ source code ofCinePaint as is inMicrosoft Visual Studio. A lightweight implementation that has POSIX-compatible header files that map POSIX APIs to call their Windows API counterparts.[61]
An optional Windows subsystem included in Windows NT-based operating systems up to Windows 2000. It supported POSIX.1 as it stood in the 1990 revision, withoutthreads orsockets.
originally OpenNT by Softway Systems, Inc., is an upgrade and replacement forMicrosoft POSIX subsystem that was purchased byMicrosoft in 1999. It was initially marketed as a stand-alone add-on product and then later included as a component inWindows Services for UNIX (SFU) and finally incorporated as a component inWindows Server 2003 R2 and later Windows OS releases under the name "Subsystem for UNIX-based Applications" (SUA), later made deprecated in 2012 (Windows 8)[62] and dropped in 2013 (2012 R2, 8.1). It enables full POSIX compliance for certainMicrosoft Windows products.[citation needed]
A compatibility layer for running Linux binary executables natively on Windows 10 and 11 using a Linux image such as Ubuntu, Debian, or OpenSUSE among others, acting as an upgrade and replacement for Windows Services for UNIX. It was released in beta in April 2016. The first distribution available was Ubuntu.
Originally created for MS-DOS, is a software package produced and maintained byMKS Inc. that provides aUnix-like environment for scripting, connectivity and portingUnix andLinux software to both 32- and 64-bitMicrosoft Windows systems. A subset of it was included in the first release ofWindows Services for UNIX (SFU) in 1998.[63][64]
Implement commonly used POSIX API functions for file, time, environment, and socket access,[65] although the support remains largely incomplete and not fully interoperable with POSIX-compliant implementations.[66][67][discuss]
^"librt(3LIB)".docs.oracle.com. man pages section 3: Library Interfaces and Headers. Oracle Corporation. 4 August 1998. Retrieved18 February 2016.librt, libposix4- POSIX.1b Realtime Extensions library [...] librt is the preferred name for this library. The name libposix4 is maintained for backward compatibility and should be avoided. Functions in this library provide most of the interfaces specified by the POSIX.1b Realtime Extension.
^Rowe, Robin (8 September 2022)."libunistd".Github. Retrieved18 February 2023.If you want to build single codebase C++ code to run on Windows, Linux and MacOS, you need this for Windows