Software Development with Linux

Book Review Advanced Programming in the UNIX Environment

TUE, 01 MAR 2011

Advanced Programming in the UNIX EnvironmentHere's another classic.  Written in 1992 by W. Richard Stevens (the second edition from 2005 was revised by Stephen A. Rago), Advanced Programming in the UNIX Environment is a must have book for any software developers working on UNIX or any other POSIX systems, even if you are not coding in C.  Knowing how it works under the cover is always a good idea.

The second edition of the book has approximately 1000 pages.  While I haven't finished reading it yet (and I'm sure most owner never read it from cover to cover anyway), I plan to.  That said, I've read enough to be able to confirm you that this book is well written and stand up to its reputation.

The book start with a nice overview of UNIX systems.  Then, it goes on explaining the various standards covered (ISO C, POSIX, and XSI).  It is interesting to see that everything in the book has been validated at least on FreeBSD 5.2.1, Linux 2.4.22 (Mandrake 9.2), Solaris 9, and Darwin 7.4.0 (Apple Mac OS X 10.3).

What exactly is covered?  Everything.  File I/O, the Standard I/O Library, Files and Directory structures, system data files, processes (environment, control, relationships), signals, threads, daemon processes, STREAMS, asynchronous I/O, memory-mapped I/O, pipes (including STREAMS-based pipes), FIFOs, semaphores, message queues, shared memory, network sockets, UNIX domain sockets, terminal I/O, pseudo terminals, etc.

For all those topics, simple and/or complete examples are given that show case the feature and how it is normally used.  In addition to that, there's two chapters that covers the development of two real software pieces : a database library and a program that communicate with a network printer.  Those two projects show how one can use all the previous materials in real applications.

Even if you do not plan on reading it cover to cover, this book can be used as an excellent reference when man pages are not enough.  I'll keep it at hand, and you should too.