what is linux posix

青灯夜游
Release: 2023-04-19 17:45:26
Original
1934 people have browsed it

In Linux, posix refers to the Portable Operating System Interface, an IEEE 1003.1 standard that defines the language interface between applications (and command-line shell and utility interfaces) and the UNIX operating system; When a UNIX program is ported from one UNI platform to another, compliance with POSIX standards ensures compatibility.

what is linux posix

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

POSIX, you must have heard this abbreviation or read about it in various online forums and articles. Programmers and system developers seem to be most concerned about this issue. It sounds mysterious, and while there's a lot of good information on the subject, some discussion boards (brevity being their hallmark) don't go into detail about what it is, which can be confusing. So, what exactly is POSIX?

Introduction to POSIX

POSIX is not so much a thing as it is a label. Imagine there is a box with a label on it: POSIX, and inside the box is a standard. The standard consists of the set of rules and instructions that POSIX focuses on. POSIX is the abbreviation of Portable Operating System Interface. It is an IEEE 1003.1 standard that defines a language interface between applications (as well as command-line shell and utility interfaces) and UNIX operating systems.

Adherence to this standard ensures compatibility when UNIX programs are ported from one UNIX platform to another. POSIX focuses primarily on the features of AT&T's System V UNIX and BSD UNIX.

The standard must clarify and follow the rules for how to achieve the goal of interoperability between operating systems. POSIX covers the following: system interfaces, commands and utilities, network file access, to name a few (POSIX is much more than that).

Why is there POSIX?

In a word: portability.

Over 60 years ago, programmers had to completely rewrite the code if they wanted their software to run on more than one system. This didn't happen often because of the expense involved, but in the mid-1960s portability became a feature -- not through POSIX, but in the mainframe world.

IBM introduces the System/360 series of mainframe computers. Different models have unique specifications, but the hardware allows them to use the same operating system: OS/360.

Not only the operating system can run on different models, applications can also run on them. This not only reduces costs but also creates "computer systems": systems that can work together across product lines. Today, this is all commonplace, like networks and systems, but at the time, it was a huge improvement!

what is linux posix

Around the same time, when UNIX came on the scene, it also made the promise that it could run on machines from different manufacturers. However, when UNIX began to spawn into different genres, porting code between these UNIX variants became difficult. The promise of UNIX portability is losing ground.

To solve this portability problem, the POSIX standard was formed in the 1980s. The standard was defined based on AT&T's System V UNIX and BSD UNIX, the two largest UNIX variants at the time. It's important to note that POSIX was not formed to control how operating systems were built, any company was free to design their variant of UNIX any way they liked. POSIX only cares about the interface between the application program and the operating system. In programmer terms, an interface is the method by which the code of one program communicates with another program. An interface expects Program A to provide a specific type of information to Program B. Likewise, Program A expects Program B to answer with a specific type of data.

For example, if I want to read a file using the cat command, I would enter something like this on the command line:

cat myfile.txt
Copy after login

I don’t want to use a lot of programmer jargon, just keep it simple Say, the cat command calls the operating system to obtain a file so that cat can read it. cat reads it and then displays the contents of the file on the screen. There is a lot of interaction between the application (cat) and the operating system. How this interaction works is what POSIX is concerned with. If this interaction is the same across different UNIX variants, then portability, regardless of operating system, manufacturer, and hardware, can be regained.

The specific details on how to achieve this are specified in the standard.

Conclusion

The POSIX standard allows developers to create applications, tools, and platforms on many operating systems using much of the same code. Anyway, writing code according to the standard is not a requirement, but it does help a lot when you want to port your code to other systems.

Basically, POSIX is for operating system designers and software developers, but as users of the system, whether we realize it or not, we are all affected by POSIX. Because of this standard, we can work on one UNIX or Linux system and take our work to another system without any problems. As users, we gain many benefits in terms of usability and data reuse across systems.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of what is linux posix. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template