LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

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


Hi,
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!

Thanks,
v333k
 
Old 02-20-2005, 07:05 PM   #2
Dave Kelly
Member
 
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.
IEEE
 
Old 02-21-2005, 12:35 AM   #3
shishir
Member
 
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 code...prime example i can think of : pthreads...you 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 )..you 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.1–1988 (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.1–1990 (356 pages) was next, and it was also known as ISO/IEC 9945–1: 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.2–1992 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.1b–1993 (590 pages) was originally known as IEEE P1003.4. This was an update to the 1003.1–1990 standard to include the real-time extensions developed by the P1003.4 working group. The 1003.1b–1993 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.1–1990 (the base API), 1003.1b–1993 (real-time extensions), 1003.1c–1995 (pthreads), and 1003.1i–1995 (technical corrections to 1003.1b). This standard was also called ISO/IEC 9945–1: 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

http://www.pasc.org/standing/sd11.html

-----------------------------------------------------------------------------------


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

Rep: Reputation: 232Reputation: 232Reputation: 232
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
Code:
COMPATIBILITY
       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
v333k
Member
 
Registered: Apr 2004
Location: 127.0.0.1
Posts: 38

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


Reply



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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:22 PM.

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