Blue Ice
Blue Ice

Reputation: 7920

C++ do OS X or Linux headers vary

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.

Upvotes: 0

Views: 547

Answers (1)

rubenvb
rubenvb

Reputation: 76720

You can be sure anything in POSIX is definitely in both OSes. This includes <termios>, <unistd.h>, and <sys/select.h>. POSIX is a superset of C99.

Apart from that, anything goes. Most common libraries used on Linux also work on BSD-type systems like Mac OS X, but they cannot be assumed to be "built-in".

The OpenGroup provides an exhaustive list of all the POSIX system interfaces.

Since the question is tagged C++, you obviously also have access to the C++ Standard library, of which a decent (but not perfect) reference is available here.

Upvotes: 2

Related Questions