Is Haiku a Unix-like OS?

It provide both APIs. That is still completely unrelated to how it achieves it internally. And the APIs aren’t all that distinct anyway: there is the same C standard library, the standard sockets (we are compatible with BONE which does them UNIX-like even on BeOS), etc.

Just like on BeOS, there is a libroot implementing the standard C library, and a libbe that builds upon that. And projects like Cosmoe and BlueEyedOS, or even our own buildsystem when building on Linux, have already shown that it’s possible to bring libbe to other UNIX operating systems without too much restrictions (there are some, still). So if anything, the Be API implementation is a wrapper over an UNIX core, more than the opposite. There are some places where the kernel has grown support for something not usually possible on a plain POSIX system, as it is the case on Linux, BSD, or pretty much any POSIX compliant system. Because POSIX tends to describe a bare minimal set of things, and if you want to implement a real OS, you are always going to extend on it in some way or another.

So, the Be API and POSIX complement each other, they are not conflicting. A typical Haiku application may for example use BSocket which is an object wrapper around an UNIX socket. They may use both UNIX sockets and Be ports to communicate with other local applications. They may easily convert a pthread identifier to a Be thread_id in order to set the thread priority in a more fine-grained way than the pthread API provides, or even just to set the thread name, which is something POSIX doesn’t provide a way of doing. They may receive their arguments through BApplication::ArgsReceived() and still parse them with the POSIX standard getopt() function.

This is not similar to, for example, some POSIX implementations for Windows, where you had to choose between using the POSIX APIs, or the Win32 ones, but it was very difficult to mix both in a single application (different and often conflicting runtime library sets would be used). But I think even Windows made some progress on this lately?

6 Likes