0

I am making a program that I want to run on both Lubuntu (linux) and Tiger (mac os x). I am including some header functions like "termios", "sys/select" and "unistd" that I have never heard of before. Which leads me to the question: Are there any built-in libraries in Linux that are not included in OS X, or vice versa? Can someone explain which ones they are? I think this would be a good thing for me to know if/when porting programs.

Thanks.

4

1 回答 1

2

您可以确定 POSIX 中的任何内容都绝对适用于两种操作系统。这包括<termios><unistd.h><sys/select.h>。POSIX 是 C99 的超集。

除此之外,任何事情都会发生。Linux 上使用的大多数常用库也适用于 BSD 类型的系统,例如 Mac OS X,但不能假定它们是“内置的”。

OpenGroup 提供了所有 POSIX 系统接口的详尽列表

由于问题已标记C++,您显然也可以访问 C++ 标准库,此处提供了一个不错的(但不完美的)参考

于 2013-05-27T14:38:00.037 回答