[comp.newprod] POSIX Programming Manual

ambar@ora.ora.com (Jean Marie Diaz) (05/03/91)

                     POSIX Programming Manual

             By Donald Lewine, available May 30, 1991
        660 pages (estimated), ISBN 0-937175-73-0, $34.95 
     (You can order from O'Reilly & Associates, 800-338-6887)

If you're a programmer or programming manager, you probably know that
it can be difficult to port a program from one system to another.  If
you have computers from many different vendors, running multiple
operating systems, you know how much you like to see code that
compiles easily on all the machines.  In practice, it is rare that
code can be ported easily--it is surprising just how much variation
there is among machines running the UNIX Operating System.

Recognizing this problem led to the development of the IEEE standard
known as POSIX (pronounced "PAH-six" and derived from Portable
Operating System based on UNIX.)  The first specification to be
formally approved was POSIX.1 (IEEE 1003.1-1990), the application's
interface to the operating system.  It describes a set of standard
functions for applications to use to obtain basic services provided by
the operating system.  POSIX provides for portability at the
source-code level.  If you write a POSIX-compliant program, then the
program can be compiled to execute on any POSIX-conforming system.

The POSIX.1 standard has also been approved by the International
Standards Organization (ISO).  It is a Federal Information Processing
standard (FIPS 151).

POSIX is also perhaps the only thing that the Open Software Foundation
and UNIX International can agree upon.  Most UNIX vendors including
Hewlett-Packard, Sun Microsystems, AT&T, IBM, Data General and Cray
Research have announced support for POSIX.  Even more noteworthy is
that vendors of several non-UNIX operating systems have announced
plans to support POSIX: Digital Equipment has said that VMS will be
POSIX-compliant and Microsoft has said that OS/2 will also.

This sounds like all good news for programmers doing commercial or
in-house program development.  But it can be difficult to find out
exactly how to use POSIX.  For one thing, the POSIX standard documents
are difficult to use for this purpose.  They are written as legal
documents in which the primary aim is to be unambiguous.  The POSIX
standard is written for the system programmer, not the application
programmer.  It is not organized for a programmer who wants to consult
it while writing programs.

Another problem is that most programmers must rely upon the
manufacturer's documentation to tell them how to use POSIX.  Each
manufacturer is required to supply a POSIX conformance document that
describes the language bindings and any implementation-specific
details.  However, it does not tell the programmer how to use the
POSIX library.  Also, what is strictly POSIX-conforming and what is
added-value specific to the manufacturer's system is seldom clear from
the manufacturer's documentation.  Even though the computer system is
POSIX-compliant, you can write non-conforming applications by making
use of the system-specific features.  Application programmers need
documentation on POSIX that they can use no matter what operating
system or machine they are using to write the program.  In fact,
having a team of programmers use the same documentation is a good way
to ensure that portability is achieved during design and
implementation of a program, and not afterwards.

The POSIX Programmer's Guide answers the need of a complete guide to
writing portable, POSIX-compliant applications.  It is made up of two
separate guides: a programming guide and a reference guide.  The
programming guide presents an overview of developing POSIX
applications.  Many chapters have a section called Pitfalls that
points out common problems in achieving portability.  The programming
guide can also be used by developers who are new to UNIX and need to
learn the application interface to UNIX.  The reference guide is
intended for everyday use by programmers.  All POSIX library functions
are listed in alphabetical order and clearly and simply documented.

Chapters include:

Introduction to POSIX
Writing a POSIX-compliant program, the basics
Input/Output facilities of the Standard C library
The file system as defined by POSIX
Operations of POSIX Input/Output system, pipes, FIFOs
Creating and terminating processes and signals
Obtaining information about the environment
Communication line settings and a cu-like utility
POSIX and Standard C, including features and portability pitfalls 
Internationalization

Reference sections include:

Complete list of library functions in alphabetic order
Complete list of data structures and their members
All error codes
Standard headers and the information that they define
Glossary 
List of related publications.

                    About the Author

Donald Lewine has been writing computer programs for fun and profit
since 1960.  He has been teaching Computer Science in the
State-of-the-Art (evening) program at Northeastern University for the
past eight years.  He has taught courses on Assembler, VAX/VMS,
PASCAL, C and UNIX.  This book was written and tested over the last
two years at Northeastern University.

Mr. Lewine spent 13 years with the Digital Equipment Corporation
developing operating systems and central processing units.  He was
Technical Director for the MicroVAX Program when he left.

For the past seven years, Mr. Lewine has been with Data General
Corporation, currently as Director of Engineering.  In this role he
has been developing the AViiON family of open systems.  He is a
founder and a member of the Board of Directors of 88open, a member of
the Board of Directors of UNIX International, and Data General's
representative to the Open Software Foundation.