POSIX是什么?我读过维基百科上的文章,每次遇到这个词我都会去读。事实上,我从来没有真正理解它是什么。
有没有人可以通过解释“POSIX的需求”来解释给我听?
POSIX是什么?我读过维基百科上的文章,每次遇到这个词我都会去读。事实上,我从来没有真正理解它是什么。
有没有人可以通过解释“POSIX的需求”来解释给我听?
当前回答
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实用指南》
其他回答
该标准为类unix操作系统提供了一个公共基础。它指定了shell应该如何工作,期望从ls和grep等命令中得到什么,以及C作者期望可用的一些C库。
例如,这里详细地指定了命令行用户用来将命令串在一起的管道,这意味着C的popen(管道打开)函数是posix标准的,而不是ISO C标准的。
POSIX是:
POSIX(发音为/ pɒzɪks/)或 便携式操作系统接口 “1是一个家族的名字 的相关标准 IEEE定义应用程序 编程接口(API),沿 使用shell和实用程序接口 为软件兼容的变种 Unix操作系统,尽管 该标准适用于任何领域 操作系统。
基本上,它是一组措施,通过拥有(大部分)公共API和实用程序来减轻开发和使用不同UNIX风格的痛苦。有限的POSIX遵从性也扩展到各种版本的Windows。
让我来给出粗鲁的“非官方”解释。
POSIX是一组标准,试图将“UNIX”和类UNIX系统与与它们不兼容的系统区分开来。它是由美国政府为采购目的而创建的。当时的想法是,美国联邦采购部需要一种方法来合法地规定各种投标和合同的要求,这种方法可以用来排除现有代码库或编程人员无法移植到的系统。
因为POSIX是事后写的……为了描述一组大致相似的竞争系统……它不是以一种可以实现的方式编写的。
因此,例如,微软的NT是用足够的POSIX一致性编写的,有资格参加一些投标…尽管POSIX子系统在实际可移植性和与UNIX系统的兼容性方面基本上是无用的。
在过去的几十年里,已经编写了各种UNIX标准。比如SPEC1170(指定了1170个函数调用,必须兼容地实现)和SUS(单一UNIX规范)的各种版本。
在大多数情况下,这些“标准”对任何实际技术应用都是不够的。它们大多是为了争论、法律纠纷和其他不正常的原因而存在的。
POSIX是IEEE指定的一系列标准,用于阐明和统一Unix-y操作系统提供的应用程序编程接口(以及辅助问题,如命令行shell实用程序)。
当您编写依赖POSIX标准的程序时,您可以相当肯定地将它们轻松地移植到大量的Unix衍生产品中(包括Linux,但不限于它!);如果你使用的某些Linux API不是Posix的一部分,那么将来你想要将该程序或库移植到其他unix系统(例如MacOSX)时,你将会遇到困难。
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指出我的错误——我的错!!:(