11-09-2013, 03:42 PM
UNIX SYSTEM PROGRAMMING
UNIX SYSTEM.pdf (Size: 932.36 KB / Downloads: 26)
UNIX AND ANSI STANDARDS:-
UNIX is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs,
including Ken Thompson, Dennis Ritchie, Douglas McElroy and Joe Ossanna. Today UNIX systems are split
into various branches, developed over time by AT&T as well as various commercial vendors and non-profit
organizations.
The ANSI C Standard:-
In 1989, American National Standard Institute (ANSI) proposed C programming language standard X3.159-
1989 to standardise the language constructs and libraries. This is termed as ANSI C standard. This attempt to
unify the implementation of the C language supported on all computer system.
The major differences between ANSI C and K&R C [Kernighan and Ritchie] are as follows:
Function prototyping
Support of the const and volatile data type qualifiers.
Support wide characters and internationalization.
Permit function pointers to be used without dereferencing.
Function prototyping
ANSI C adopts C++ function prototype technique where function definition and declaration include function
names, arguments’ data types, and return value data types. This enables ANSI C compilers to check for function
calls in user programs that pass invalid number of arguments or incompatible arguments’ data type.
These fix a major weakness of K&R C compilers: invalid function calls in user programs often pass compilation
but cause programs to crash when they are executed.
Differences between ANSI C and C++
Uses K&R C default function declaration for any functions that are referred before their declaration in the
program. Requires that all functions must be declared / defined before they can be referenced. int foo();ANSI C
treats this as old C function declaration & interprets it as declared in following manner. int foo(..); meaning
that foo may be called with any number of arguments. int foo();C++ treats this as int foo(void); Meaning that foo
may not accept any arguments. Does not employ type_safe linkage technique and does not catch user errors.
Encrypts external function names for type_safe linkage. Thus reports any user errors.
The POSIX standards
POSIX or “Portable Operating System Interface” 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 interface for
the software compatible with variants of the UNIX operating system.
Because many versions of UNIX exist today and each of them provides its own set of API functions, it is
difficult for system developers to create applications that can be easily ported to different versions of
UNIX.
Some of the subgroups of POSIX are POSIX.1, POSIX.1b & POSIX.1c are concerned with the
development of set of standards for system developers.
The X/OPEN Standards
The X/Open organization was formed by a group of European companies to propose a common
operating system interface for their computer systems. The portability guides specify a set of common
facilities and C application program interface functions to be provided on all UNIX based open systems.
In 1973, a group of computer vendors initiated a project called “common open software environment”
(COSE). The goal of the project was to define a single UNIX programming interface specification that
would be supported by all type vendors. The applications that conform to ANSI C and POSIX also
conform to the X/Open standards but not necessarily vice-versa.