What is POSIX?


I know the acronym Portable Operating System Interface (POSIX), but what is it? Is it UNIX? Can not Windows be POSIX?

What does it matter to the developer?

asked by anonymous 04.04.2017 / 12:57

1 answer


What is it?

POSIX as the name suggests, is a standard for determining common interfaces between operating systems.

POSIX is nothing more than a way to dictate various expected features of an operating system. Usually when we write and compile programs in C and C ++ it is common to take some system behaviors as truth.

For example, when we are using a command interpreter that is compatible with POSIX, it is expected that it will be possible to invoke the ls command.

Where did it come from?

In the 1970s and 1980s several operating system initiatives began to emerge, and as each company / developer made its own interfaces it became apparent that standardization was necessary.

To try to make programs more compatible across multiple operating systems, POSIX was written. It basically defines system calls, basic commands (such as awk and echo), a shell script compatible shell interpreter, various expected system behaviors (such as signals, pipes, basic process management, etc.).

Note : It is important to remember that Richard Stallman is one of the authors of POSIX.

What does UNIX have to do with POSIX?

UNIX served as the basis for the standard because it was more neutral so to speak. This does not mean that it is 100% compatible.

Is Windows compatible?

In a way, we can say yes. If you read the pattern closely, you will realize that the Linux kernel also does not meet the 100% standard. The big difference between Windows and Linux is that in Windows we have a much lower compatibility.

Note : MacOS since version 10.5 Leopard is certified as compatible with POSIX.

What does it matter to the developer?

Normally when writing a cross-platform program, it is necessary to study which interfaces are implemented and which are not. Usually we have libraries that treat these differences for the programmer.

It is very common today to avoid using Shell Script when we are going to aim at Windows because it is not supported. That's why it's so common to see Python configuration scripts or one shell script and one bat script.

04.04.2017 / 14:55