views:

264

answers:

4

I have searched hard but still confused why POSIX is called "Portable Operating System Interface", what I learned is that it is some threading library for Unix environment, because when you need to use it under windows you have to use cygwin or "Windows Services of Unix", etc. That's why I am confused why it is called Portable OSIX. I am a professional C/C++ programmer in Windows domain but new in Unix/Linux. Thanks for your answers in advance.

+5  A: 

That one or two stragglers have decided to not make it part of their core doesn't not make it any less portable to almost every other important operating system.

Ignacio Vazquez-Abrams
Can you kindly define your opinion / answer , i am not good enough in English to understand this thanks.
Most operating systems *do* follow POSIX to some extent. Only a few have decided not to.
Ignacio Vazquez-Abrams
+1 for platform bigotry. amusing platform bigotry at that.
asveikau
+10  A: 

Before Posix, the Unix family tree was becoming very diverse and incompatible. A program written for one Unix was not compatible with a different Unix without significant porting effort.

Posix was one of the attempts to present a common set of utilities and programming interfaces so that your software would be portable to multiple versions of Unix.

Since Posix is about the interface and not the actual OS, it is possible to have a Posix facade on a non Unix OS (such as the Microsoft Windows Services for Unix presenting a Posix facade on top of Windows).

R Samuel Klatchko
Oh that means POSIX is only portable to various versions on UNIX, I thought is was heterogeneously portable. I have fedoraCore10 installed can you give me a start point how to start programming with pThreads in fedoraCore10. thanks.
Posix could also be done on non Unix OS's (such as Windows). I've added a new paragraph to my answer to explain that more.
R Samuel Klatchko
Thank-you very very much for your interest and kind answers, the link you provided is really useful. thanks again
+4  A: 

POSIX is simply an interface for operating systems that defines concepts like threads, processes, signals, pipes and I/O. This is not the only interface that's portable across multiple interfaces, but is simply one standard. The name was actually defined by Richard Stallman in the 1980s.

The reason for defining POSIX was that many different versions of UNIX were incompatible, because operating systems hadn't agreed on the implementation of threading or processes.

Here are some more links for further research:

James Thompson
The RMS link is well-documented. What I've never been able to confirm, though, is whether it was intended as a joke (the committee was creating a P.o.S.) or not. No one wants to tell...
Andy Ross
+2  A: 

POSIX defines a set of portable C functions, shell, programs that make the life of a programmer easier because given the definitions in POSIX, it is much more easier to write portable code (not just C, but shell scripts too). Imagine if everyone had their own way of doing things!

Not all the operating systems are POSIX compliant, so if you have to develop for those too, you have to do system-specific things. But POSIX is probably the portable standard across different kinds of systems today. Sure, there is ISO C, which is more portable, but then it's hard to write very useful programs in just ISO C!

Alok