Abstract


  • Stands for Portable Operating System Interface
  • A set of standards designed by IEEE in the form of POSIX Function, specifying the interface between Kernel and OS System Program. Comes with a set of automated conformance test to check if a kernel is POSIX-compatible

Write Once, Run (Mostly) Anywhere

POSIX ensures compatibility and portability of applications across different Unix-like operating systems.

A POSIX-compliant application written using the POSIX function should be compatible across different POSIX-compliant operating systems. This massively reduces the development effort for cross-platform software.

Guidance for kernel vendores

Kernel vendors have a blueprint for the set of system calls that should ideally be implemented in their systems for better standardisation.

POSIX Function


  • POSIX has about 100 functions, some commonly used functions are shown above. Services offered by these functions determine most of what the OS has to do
  • Mapping of POSIX functions onto System Call (系统调用) isn’t one-to-one. The POSIX standard specifies a number of functions a Kernel must supply, but it doesn’t specify whether they are system call, Library Call or something else
  • However, most POSIX functions do invoke system calls, usually with one POSIX function mapping directly onto one system call, unless the POSIX functions are only minor variations of each other

Important

For Linux, it is the combination of Linux Kernel and libc that provides the POSIX API. libc adds a decent amount of value - not every POSIX function is necessarily a system call, and for the ones that are, the kernel behaviour isn’t always POSIX conforming.

So decoupling out some of the POSIX implementations into libc, we achieve a faster and more POSIX-compliant system. It is faster because we reduce the involvement of kernel, involving kernel is expensive! Great overhead introduced by Trap Interrupt (陷入) and Interrupt Handler etc.

References