# POSIX
POSIX (Portable Operating System Interface) is a family of standards specified by IEEE and standardized by ISO, defining the API, command-line interface, and utility interfaces for Unix-like operating systems. The name was suggested by [[Richard Stallman]] in response to an IEEE request. First published in 1988 as IEEE 1003.1, POSIX ensures software portability across different Unix variants.
POSIX compliance means applications can run on any conforming system with minimal modification. While no operating system is fully POSIX-compliant, [[Linux]], macOS (certified), FreeBSD, and other Unix-like systems implement most POSIX standards, enabling portable shell scripts and C programs across platforms.
## What POSIX Defines
- **System calls**: File operations, process control, signals
- **C library functions**: Standard functions like `fork()`, `exec()`, `open()`
- **Shell and utilities**: [[Bash]]-compatible shell, standard commands (ls, grep, awk)
- **Threading**: POSIX threads (pthreads) API
- **Regular expressions**: Basic and extended regex syntax
- **Environment variables**: PATH, HOME, USER conventions
## POSIX Compliance Levels
| System | Compliance |
|--------|------------|
| macOS | Certified POSIX-compliant (UNIX 03) |
| Linux | Mostly compliant, not certified |
| FreeBSD | Mostly compliant, not certified |
| Windows | Partial (WSL provides POSIX layer) |
| Solaris | Certified POSIX-compliant |
## Key Standards
| Standard | Description |
|----------|-------------|
| POSIX.1 | Core OS interface (system calls, C library) |
| POSIX.2 | Shell and utilities |
| POSIX.1b | Real-time extensions |
| POSIX.1c | Threads (pthreads) |
| POSIX.1-2017 | Current combined standard |
## Why POSIX Matters
- **Portability**: Write once, run on multiple Unix-like systems
- **Shell scripts**: POSIX-compliant scripts work across platforms
- **Standards compliance**: Common baseline for Unix-like development
- **Interoperability**: Consistent behavior expectations
## References
- https://pubs.opengroup.org/onlinepubs/9699919799/
- https://en.wikipedia.org/wiki/POSIX
- IEEE Std 1003.1-2017
## Related
- [[Linux]]
- [[GNU is not Unix (GNU)]]
- [[Bash]]
- [[Unix]]
- [[Richard Stallman]]
- [[Free and Open Source Software (FOSS)]]