Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 02-20-2005, 06:56 PM   #1
Registered: Apr 2004
Posts: 38

Rep: Reputation: 15
c programming compliant with posix ---HELP!

My professor assigned a programming assignment and he said that it needs to be compliant with posix. I have no clue what that means? I searched on some search engines but I ended up with hits that mention the word "posix" in them, but nothing that helped.

If you have any links or explanation to what this posix is, please let me know. I am lost at the moment!

Old 02-20-2005, 07:05 PM   #2
Dave Kelly
Registered: Aug 2004
Location: Todd Mission Texas
Distribution: Linspire
Posts: 215

Rep: Reputation: 31
I was going to tell you to search google. But I got over 3 million hits when I did and figured that was not enough to tell you the answer to your question.

So I went to the first place listed to get the answer to your question.
Old 02-21-2005, 12:35 AM   #3
Registered: Jul 2003
Location: bangalore . india
Distribution: openSUSE 10.3
Posts: 251

Rep: Reputation: 33
POSIX helps you keep your programs running on different systems without having to modify the example i can think of : can have a program run on different systems that implement threads in different ways...also, all the calls ending in _r (the re-entrant versions are POSIX compliant ) might be able to dig up some docs that list all the POSIX calls...

this is from the UNP Vol. 1 by Richard Stevens
Background on POSIX
POSIX is an acronym for Portable Operating System Interface. POSIX is not a single standard, but a family of standards being developed by the Institute for Electrical and Electronics Engineers, Inc., normally called the IEEE. The POSIX standards have also been adopted as international standards by ISO and the International Electrotechnical Commission (IEC), called ISO/IEC. The POSIX standards have an interesting history, which we cover only briefly here:

IEEE Std 1003.11988 (317 pages) was the first POSIX standard. It specified the C language interface into a Unix-like kernel and covered the following areas: process primitives (fork, exec, signals, and timers), the environment of a process (user IDs and process groups), files and directories (all the I/O functions), terminal I/O, system databases (password file and group file), and the tar and cpio archive formats.

The first POSIX standard was a trial-use version in 1986 known as "IEEE-IX." The name "POSIX" was suggested by Richard Stallman.

IEEE Std 1003.11990 (356 pages) was next, and it was also known as ISO/IEC 99451: 1990. Minimal changes were made from the 1988 to the 1990 version. Appended to the title was "Part 1: System Application Program Interface (API) [C Language]," indicating that this standard was the C language API.

IEEE Std 1003.21992 came next in two volumes (about 1,300 pages). Its title contained "Part 2: Shell and Utilities." This part defined the shell (based on the System V Bourne shell) and about 100 utilities (programs normally executed from a shell, from awk and basename to vi and yacc). Throughout this text, we will refer to this standard as POSIX.2.

IEEE Std 1003.1b1993 (590 pages) was originally known as IEEE P1003.4. This was an update to the 1003.11990 standard to include the real-time extensions developed by the P1003.4 working group. The 1003.1b1993 standard added the following items to the 1990 standard: file synchronization, asynchronous I/O, semaphores, memory management (mmap and shared memory), execution scheduling, clocks and timers, and message queues.

IEEE Std 1003.1, 1996 Edition [IEEE 1996] (743 pages) came next and included 1003.11990 (the base API), 1003.1b1993 (real-time extensions), 1003.1c1995 (pthreads), and 1003.1i1995 (technical corrections to 1003.1b). This standard was also called ISO/IEC 99451: 1996. Three chapters on threads were added, along with additional sections on thread synchronization (mutexes and condition variables), thread scheduling, and synchronization scheduling. Throughout this text, we will refer to this standard as POSIX.1. This standard also contains a Foreword stating that ISO/IEC 9945 consists of the following parts:

Part 1: System API (C language)

Part 2: Shell and utilities

Part 3: System administration (under development)

Parts 1 and 2 are what we call POSIX.1 and POSIX.2.

Over one-quarter of the 743 pages are an appendix titled "Rationale and Notes." This appendix contains historical information and reasons why certain features were included or omitted. Often, the rationale is as informative as the official standard.

IEEE Std 1003.1g: Protocol-independent interfaces (PII) became an approved standard in 2000. Until the introduction of The Single Unix Specification Version 3, this POSIX work was the most relevant to the topics covered in this book. This is the networking API standard and it defines two APIs, which it calls Detailed Network Interfaces (DNIs):

DNI/Socket, based on the 4.4BSD sockets API

DNI/XTI, based on the X/Open XPG4 specification

Work on this standard started in the late 1980s as the P1003.12 working group (later renamed P1003.1g). Throughout this text, we will refer to this standard as POSIX.1g.

The current status of the various POSIX standards is available from


Last edited by shishir; 02-21-2005 at 12:36 AM.
Old 02-21-2005, 03:20 AM   #4
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,571

Rep: Reputation: 180Reputation: 180
What i meas in the real life... Most Linux system functions are POSIX. When you view their manuals, let's say
man 2 time
You have at the end something like
       SVr4, SVID, POSIX, X/OPEN, BSD 4.3
If you have POSIX on that list, the function is one you can use.

Just program as usual, but it's be great if you write in pure C (with --ansi switch). But when you're about to use a system call, check its manual and see if you can use it. In practice, you will be able to use nearly all.
Old 02-28-2005, 03:08 PM   #5
Registered: Apr 2004
Posts: 38

Original Poster
Rep: Reputation: 15
I think I should be able to go from here on my own!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
POSIX Thread programming problem... rajsun Programming 0 10-07-2005 11:18 PM
Posix programming environment setup jfitzger68 Programming 5 07-22-2005 01:12 PM
Open source, posix compliant, person renderer? Elomis Linux - Software 0 01-10-2005 04:21 PM
POSIX and Graphics programming in C varunnarang Programming 3 01-05-2005 09:27 AM
POSIX thread Programming msriram_linux Programming 4 11-21-2004 03:14 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:53 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration