What Is POSIX (Portable Operating System Interface) and It’s Relation with Linux?
What is POSIX? We hear this term in Linux and Unix world but do not understand the meaning of POSIX. POSIX is the short form of
Portable Operating System Interface . Lets start explaining everything about the POSIX.
IEEE POSIX Standard
POSIX is a standard developed for Unix operating systems. At the old times Unix has a lot od different implementations. This was creating problems about portability. One application developed for one Unix variant like HUX do not worked other Unix variant like IBM. This was really problem for enterprises.
IEEE is a global forum which sets standards about Elecric, electronic and IT systems. IEEE created POSIX standard with versions.
POSIX consist of different sub standards. It provides standards for
Programming API ,
Utilities etc. These sub standards are numbered from 1 to 7 but it can increase if new sub standard created.
POSIX.1 or C API
This standard extend ANSI C standard and ad some concepts, operations and libraries like
kill , networking, regular expression and Linux system calls.
POSIX.2 or CLI Utilities
As Linux and Unix are CLI based operating systems they rely on CLI tools. This standard defines commands like
echo , … . These are generally provided by shell environment or GNU Coreutils.
POSIX.3 or Shell Language
This substandard defined some shell language and programming basics like
echo $a etc. Bash, Csh or `KornShell complies this standard.
POSIX.4 or Environment Variables
Environment variables are simple variables used to store about system, session, user , network in the shell or similar tool.
PATH are most popular environment variables.
POSIX.5 or Program Exit Status
This is very basic standard used to defined applications exit status and process signals.
POSIX.6 or Regular Expression
This feature is used to match strings in a structured way. There are two type of regular expression. Basic Regular Expression (BRE) provide basic features.
Extended Regular Expression(ERE) provides advanced features.
POSIX.7 or Directory Structure
This is an important part of the POSIX sub standard. Operating system and user related files must be stored in a appropriate path and folders. For example configuration files are stored in
/dev/null is used to create empty data.
POSIX.8 or File Names
File names are important because there are enormous type of file names. This sub standard defines how a file can be named and how a different chars like
.. will interpreted.
POSIX.9 or Command Line API Utility Conventions
Not mandatory but used by POSIX. Most known concept is
- is expressed as stdin file expected.
Linux POSIX Compability
Most Linux distributions like Ubuntu, Debian, RedHat, CentOS, Fedora are compatible with the POSIX standard. But in order to certify with POSIX they need to pay some money. So they do not prefer to pay money and conform with the POSIX standard
Windows POSIX Compability
Windows have complied with POSIX in the past. Windows ME was POSIX compiled but with the Windows XP and Windows Server 2003 POSIX compability broken. So current versions like Windows 7, Windows 8, windows 10, Windows Server 2008, Windows Server 2012, Windows Server 2016 do not conforms POSIX standard.
But there are some sub system named
Windows Subsystem for Linux which is introduced in 2016 conforms POSIX.
Also 3rd party framework named Cygwin also complies with POSIX too.
POSIX Compatible Operating Systems
Well old fashion Unix distributions like AIX, HP-UX and Solaris are conforming and certified as POSIX compilant.