Linux OSX 是 POSIX 操作系统吗?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5785516/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is OSX a POSIX OS?
提问by node ninja
What is it that makes an OS a POSIX system? All versions of Linux are POSIX, right? What about OSX?
是什么使操作系统成为 POSIX 系统?所有版本的 Linux 都是 POSIX,对吧?OSX 呢?
回答by Rafe Kettler
Yes. POSIX is a group of standards that determine a portable API for Unix-like operating systems. Mac OSX is Unix-based (and has been certified as such), and in accordance with this is POSIX compliant. POSIX guarantees that certain system calls will be available.
是的。POSIX 是一组标准,用于确定类 Unix 操作系统的可移植 API。Mac OSX 是基于 Unix 的(并且已经过此类认证),因此符合 POSIX 标准。POSIX 保证某些系统调用可用。
Essentially, Mac satisfies the API required to be POSIX compliant, which makes it a POSIX OS.
本质上,Mac 满足 POSIX 兼容所需的 API,这使其成为 POSIX 操作系统。
All versions of Linux are not POSIX-compliant. Kernel versions prior to 2.6 were not compliant, and today Linux isn't officially POSIX-compliant because they haven't gone out of their way to get certified (which will likely never happen). Regardless, Linux can be treated as a POSIX system for almost all intents and purposes.
并非所有版本的 Linux 都符合 POSIX。2.6 之前的内核版本不兼容,而今天的 Linux 还不是正式的 POSIX 兼容,因为它们还没有竭尽全力获得认证(这可能永远不会发生)。无论如何,对于几乎所有意图和目的,Linux 都可以被视为 POSIX 系统。
回答by anta40
POSIX is a specification: http://www.unix.org/what_is_unix/single_unix_specification.htmlAFAIK, Linux adheres to the spec, but hasn't certified yet
POSIX 是一个规范:http: //www.unix.org/what_is_unix/single_unix_specification.htmlAFAIK,Linux 遵守规范,但尚未认证
回答by arober11
Yes, OS X is based on Darwin BSD, and since 10.5 (Leopard - 18-May-2007) all Intel/AMD versions have been officially certified as compliant with the Unix 03 / POSIX standard eg.
是的,OS X 基于Darwin BSD,并且自 10.5(Leopard - 2007 年 5 月 18 日)以来,所有 Intel/AMD 版本都已被正式认证为符合 Unix 03 / POSIX 标准,例如。
回答by Eric Toombs
No, it is not. MacOS is missing a whole bunch of features of POSIX, like clock_nanosleep()
. It might be compliant with a subset of POSIX or with a really really old version of POSIX, but it's definitely not compliant with POSIX.1-2017. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html.
不它不是。MacOS 缺少 POSIX 的一大堆功能,比如clock_nanosleep()
. 它可能符合 POSIX 的一个子集或非常旧的 POSIX 版本,但它绝对不符合 POSIX.1-2017。请参阅http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html。