tags:

views:

1199

answers:

6

What is POSIX? I read the Wikipedia article and I read it ever time I encounter the term. Fact is that I never really understood what it is.

Can anyone please explain it to me by explaining "the need for POSIX" too?

+5  A: 

POSIX is a standard for operating systems that was supposed to make it easier to write cross-platform software. It's an especially big deal in the world of Unix.

Hank Gay
It isn't just "supposed to" make it easier to write cross-platform code, it does make it easier to write cross-platform code. The only exception is Windows, because Microsoft thinks it is somehow better than everyone else and does not need to comply. However, I predict this will work against them, especially as Mac and Linux gain more market share. If they really are for the "developers, developers, developers", they will realize that developers want UNIX compliance.
Michael Aaron Safyan
Based on what I've heard from people who work with it much more closely than I ever did, it may have made things easier, but it certainly wasn't sufficient for the write-once, run-on-any-POSIX impression most people get when they hear it's a "standard" for operating systems.
Hank Gay
They don't think they're "better than everyone else"; they know they're *bigger* than everyone else. That's also why they'll change their tune as they lose market share. It's not unique to them, e.g., Netscape started caring a lot more about web standards when they were no longer the most popular.
Ken
+19  A: 

POSIX is:

POSIX (pronounced /ˈpɒzɪks/) or "Portable Operating System Interface [for Unix]"[1] is the name of a family of related standards specified by the IEEE to define the application programming interface (API), along with shell and utilities interfaces for software compatible with variants of the Unix operating system, although the standard can apply to any operating system.

Basically it was a set of measures to ease the pain of development and usage of different flavours of UNIX by having a (mostly) common API and utilities. Limited POSIX compliance also extended to various versions of Windows.

cletus
1. You mean POSIX says that all *nix OSes (kernels) should have atleast these set of system calls. right? 2. does WINDOWS/MAC follows POSIX? If/Ifnot does WINDOWS (95,98,2000,xp,vista,7) is following some common standard (may be their own proprietary) standard? In other words, POSIX in Microsoft world ==?
claws
Basically it "was" a set of measures to ease the pain of development.WAS??
claws
I questioned the use of the word *was*, too, but it's debatable. To answer your questions: (1) no, POSIX has absolutely zilch to do with the kernel, it just describes how it should operate; (2) OS X is BSD and is quite POSIX-compliant, but there are gray areas. Windows 2008 is closest to POSIX complaint; there is no equivalent of POSIX in the Microsoft world.
Jed Smith
Where can I read this specs? I just want to have glance at them.
claws
@claws: Don't mean to dirty up the area under cletus's answer...but. I linked POSIX.1-2008 in my answer...right there.
Jed Smith
@Jed Smith, there are no gray areas in terms of Mac OS X compliance; Mac OS X is certified compliant with the Single UNIX Specification v3, a standard of which POSIX is a subset.
Michael Aaron Safyan
@claws, you can read the Single UNIX Specification, of which POSIX is a subset, at the following link: http://www.unix.org/single_unix_specification/
Michael Aaron Safyan
@cletus, Windows is not POSIX conformant. Period.
Michael Aaron Safyan
That use of was is wrong. POSIX _is_ a standard, the latest version of which is IEEE Std 1003.1-2008 and ISO/IEC 9945:2009.
ninjalj
+13  A: 

POSIX is a set of standards put forth by IEEE and The Open Group that describes how an ideal Unix would operate. Programmers, users, and administrators can all become familiar with the POSIX document, and expect a POSIX-complaint Unix to provide all of the standard facilities mentioned.

Since every Unix does things a little differently -- Solaris, Mac OS X, IRIX, BSD, and Linux all have their quirks -- POSIX is especially useful to those in the industry as it defines a standard environment to operate in. For example, most of the functions in the C library are based in POSIX; a programmer can, therefore, use one in his application and expect it to behave the same across most Unices.

However, the divergent areas of Unix are typically the focus, rather than the standard ones.

The great thing about POSIX is that you're welcome to read it yourself:

The Open Group Base Specifications Issue 7

Issue 7 is known as POSIX.1-2008, and there are new things in there -- however, Google-fu for POSIX.1 and such will allow you to see the entire history behind what Unix is.

Jed Smith
I think you are using the term "UNIX" incorrectly. UNIX now refers to the Single UNIX Specification, and any UNIX operating system is an operating system that conforms to the Single UNIX Specification. Perhaps you mean UNIX-like?
Michael Aaron Safyan
@Michael: Given your comments in other answers, you're obviously a very polarized person with opinions that aren't exactly constructive. This specific comment is very pedantic, and my meaning was conveyed regardless of the choice of a label that you might disagree with. Also, Windows is POSIX compliant in the higher-end versions. Take a breath and step back, please.
Jed Smith
@Jed Smith, strong opinions aside, the implication of the post is that some operating systems that are certified UNIX compliant are not... so, I think it is fair to say that that is misleading. Also, with regard to Windows, so long as there are editions that are not compliant, developers cannot rely on POSIX when targeting the Windows platform, thereby negating the entire purpose of having POSIX.
Michael Aaron Safyan
+14  A: 

POSIX is a family of standards, specified by the IEEE, to clarify and make uniform the application programming interfaces (and ancillary issues, such as commandline shell utilities) provided by Unix-y operating systems. When you write your programs to rely on POSIX standards, you can be pretty sure to be able to port them easily among a large family of Unix derivatives (including Linux, but not limited to it!); if and when you use some Linux API that's not standardized as part of Posix, you will have a harder time if and when you want to port that program or library to other Unix-y systems (e.g., MacOSX) in the future.

Alex Martelli
1. You mean POSIX says that all *nix OSes (kernels) should have atleast these set of system calls. right? 2. does WINDOWS/MAC follows POSIX? If/Ifnot does WINDOWS (95,98,2000,xp,vista,7) is following some common standard (may be their own proprietary) standard? In other words, POSIX in Microsoft world ==?
claws
No, the standard is at an API level -- each specified call can be implemented in the kernel, or in the C library in terms of another call, and that's just fine for Posix (and for your programs too;-). MacOSX is Posix compliant, see http://devworld.apple.com/leopard/overview/osfoundations.html . For Windows, see http://en.wikipedia.org/wiki/POSIX#POSIX_for_Windows : Posix compliance is currently included in Enterprise and Ultimate editions only (not in the cheaper ones!-), though you can get partways w/Cygwin, http://en.wikipedia.org/wiki/Cygwin .
Alex Martelli
Damn the MICROSOFT. Thought I love it, it never follows what the world follows. They are proud of it but sometimes it becomes pain in the ass.
claws
Your comment is flawed, as Microsoft's market share on desktops, at least, makes it "what the world follows".
Jed Smith
I think what claws meant is that Microsoft doesn't put much effort into being interoperable with other platforms.
mipadi
A: 

Posix governs interoperability, portability, and in other areas such as the usage and mechanism of fork, permissions and filesystem standards such as /etc, /var, /usr and so on . Hence, when developers write a program under a Posix compliant system such as for example Linux, it is generally, not always, guaranteed to run on another posix compliant system such as IBM's AIX system or other commercial variants of Unix. Posix is a good thing to have as such it eases the software development for maximum portability which it strives for. Hope this answer makes sense. Best regards, Tom.

Thanks to Jed Smith & Tinkertim for pointing out my error - my bad!!! :(

tommieb75
Filesystem standards are handled outside of POSIX.
Jed Smith
You are confusing POSIX with things like the LSB (Linux Standard Base). Two (mostly) POSIX compliant operating systems would be FBSD and Linux, yet both have rather different file system organization and default library installations.
Tim Post
+4  A: 

Get me give the churlish "unofficial" explanation.

POSIX is a set of standards which attempts to distinguish "UNIX" and UNIX-like systems from those which are incompatible with them. It was created by the U.S. government for procurement purposes. The idea was that the U.S. federal procurements needed a way to legally specify the requirements for various sorts of bids and contracts in a way that could be used to exclude systems to which a given existing code base or programming staff would NOT be portable.

Since POSIX was written post facto ... to describe a loosely similar set of competing systems ... it was NOT written in a way that could be implemented.

So, for example, Microsoft's NT was written with enough POSIX conformance to qualify for some bids ... even though the POSIX subsystem was essentially useless in terms of practical portability and compatibility with UNIX systems.

Various other standards for UNIX have been written over the decades. Things like the SPEC1170 (specified eleven hundred and seventy function calls which had to be implemented compatibly) and various incarnations of the SUS (Single UNIX Specification).

For the most part these "standards" have been inadequate to any practical technical application. They most exist for argumentation, legal wrangling and other dysfunctional reasons.

Jim Dennis
Then how come Linux implement most of POSIX, including many of the extensions?
ninjalj
@ninjalj: Linux was written to implement a practical set of UNIX-like functions. Doing so while conforming to POSIX makes perfect sense. However, my point was that POSIX wasn't created as a specification for implementing new operating systems ... it was created as a way for U.S. government procurement staff to distinguish among those which qualified for certain categories in bids from those which wouldn't.The focus in Linux is to provide the usable features in a way which is reasonable compatible, robust and performant. POSIX is not quite an accident along the way.
Jim Dennis