POSIX是什么?我读过维基百科上的文章,每次遇到这个词我都会去读。事实上,我从来没有真正理解它是什么。

有没有人可以通过解释“POSIX的需求”来解释给我听?


当前回答

Posix governs interoperability, portability, and in other areas such as the usage and mechanism of fork, permissions and filesystem standards such as /etc, /var, /usr and so on . Hence, when developers write a program under a Posix compliant system such as for example Linux, it is generally, not always, guaranteed to run on another posix compliant system such as IBM's AIX system or other commercial variants of Unix. Posix is a good thing to have as such it eases the software development for maximum portability which it strives for. Hope this answer makes sense.

感谢Jed Smith和Tinkertim指出我的错误——我的错!!:(

其他回答

In 1985, individuals from companies throughout the computer industry joined together to develop the POSIX (Portable Operating System Interface for Computer Environments) standard, which is based largely on the UNIX System V Interface Definition (SVID) and other earlier standardization efforts. These efforts were spurred by the U.S. government, which needed a standard computing environment to minimize its training and procurement costs. Released in 1988, POSIX is a group of IEEE standards that define the API, shell, and utility interfaces for an operating system. Although aimed at UNIX-like systems, the standards can apply to any compatible operating system. Now that these stan- dards have gained acceptance, software developers are able to develop applications that run on all conforming versions of UNIX, Linux, and other operating systems.

摘自《Linux实用指南》

POSIX是IEEE和开放组织提出的一组标准,描述了理想的Unix如何运行。程序员、用户和管理员都可以熟悉POSIX文档,并期望POSIX投诉Unix提供所有提到的标准功能。

由于每个Unix的工作方式都略有不同——Solaris、Mac OS X、IRIX、BSD和Linux都有自己的怪癖——POSIX对业内人士特别有用,因为它定义了一个标准的操作环境。例如,C库中的大多数函数都基于POSIX;因此,程序员可以在他的应用程序中使用一个,并期望它在大多数unix中表现相同。

然而,Unix的不同领域通常是重点,而不是标准领域。

POSIX的伟大之处在于,欢迎您自己阅读:

开放组基础规范第7期

第7版被称为POSIX.1-2008,其中有新的东西——但是,POSIX.1的Google-fu等将允许您看到Unix背后的整个历史。

另一方面,POSIX代表“可移植操作系统接口”,POSIX是一组定义操作系统和应用软件之间接口的标准。POSIX类似于UNIX标准,它旨在确保为一个POSIX兼容的操作系统编写的软件可以在其他POSIX兼容的操作系统上运行而无需修改。

POSIX标准定义了一组在基于unix的操作系统中常见的系统调用、库和实用程序。

许多操作系统,包括Linux、BSD和macOS,都是POSIX兼容的,这意味着它们满足POSIX标准中定义的要求。

Posix更像是一个操作系统,它是一个“操作系统标准”。你可以把它想象成一个虚构的操作系统,它实际上并不存在,但它有一个文档。这些论文是由IEEE定义的“posix标准”,IEEE是美国的大型标准组织。 实现该规范的操作系统是“posix兼容的”。

政府法规在投资中更倾向于posix兼容的解决方案,因此posix兼容具有显著的财务优势,特别是对于美国的大型IT公司。

一个完全兼容posix的操作系统的回报是,它可以保证无缝地编译和运行所有兼容posix的应用程序。

Linux是最著名的。OSX、Solaris、NetBSD和Windows NT也可以在这里使用。Free和OpenBSD只是“几乎”兼容posix。WinNT的posix-compliance只是避免上述政府监管的伪解决方案。

关于POSIX的一些事实并不那么明朗。

POSIX也是系统调用接口或API,它有将近30年的历史。

它被设计用于对本地存储的串行数据访问,使用具有单个cpu的单台计算机。

在POSIX的设计中,安全性并不是一个主要的问题,这导致了多年来大量的竞争条件攻击,迫使程序员绕过这些限制。

严重的错误仍在被发现,这些错误本可以通过更安全的POSIX API设计来避免。

POSIX期望用户一次发出一个同步调用,并在发出下一个调用之前等待它的结果。今天的程序员希望一次发出许多异步请求,以提高总体吞吐量。

这种同步API对于访问远程和云对象尤其不利,因为在这些地方,高延迟很重要。