Book Review: Advanced Programming in the UNIX Environment Second Edition

With a foreword from Dennis Ritchie, co-creator of Unix and sole inventor of the C programming language, which stresses both standards and quality literature with regard to the longevity of such an aging operating system, this updated and totally classic title is well assured of its pedigree. The original work, penned by Stevens and published way back in 1992 has long been considered one of the great works within the canon of computing literature. Yet the standards, core technologies and culture of Unix-like OSes have certainly changed a good deal, as can well be gleaned from the original preface which opens this great work.


Indeed, in terms that it would be difficult to imagine being written even only a few years back, co-author Rago, who is alone responsible for upgrading the late Stevens work, writes of GNU/Linux as totally changing the face of the Unix industry, proving increasingly popular against proprietary System V variants, of which Solaris is perhaps the only Unix descendent of note. Material has thus been updated to reflect this major shift, and although it can be argued that standard programming interfaces, such as POSIX.1 in which this work is rooted, have allowed the transition from closed to open systems by way of decent documentation, it can also be argued that the sheer prevalence of Linux as Unix-like OS makes for a new standard itself.

Alongside such major core tech upgrades, with often lengthy and well commented code examples now tested and running under a 2.4.22 Linux kernel, Solaris 9, Darwin and FreeBSD, material has been added, reworked and in a good few instances deleted to reflect other changes. Standards-wise a good many more interfaces are now covered by POSIX.1 and thus find their way into this work, for example threads and sockets. And the lengthy case study walking through PostScript printer communication has been updated to relect more common networked access. A chapter on modem communication has thankfully been snipped.

Advanced has been reworked all round, and decently spruced up with the same clarity which marked its predecessor. However, it does still maintain a rather stuffy and dusty school feel in both style and content, with worthy chapters covering Terminal I/O and Pseudo Terminals doing little to brighten matters in this regard. The stress on standards is admirable, yet the early comparisons between C and POSIX standards across various iterations and platforms makes for heavy reading. Of course, it's worth stating that such material is essential for those concerned with portability of a contemporary Unix app, or indeed with porting older software from a now deprecated Unix-like OS.

Advanced runs smoothly and cleanly along the rails of firm and well oiled principles which few could argue with. It's all about interfaces, how the kernel exposes its environment and underlying hardware resources by way of system calls and higher level libraries based on these to application programmers. And after all interfaces are all about standards. Just as in the realm of natural language cultural agreement is necessary as to often nuanced meanings, documentation is a way of clarifying, affirming and thus communicating standards, in this instance our system calls and library functions. In an exemplary early chapter which maps out the Unix system and dives right into code-led examples, such a tight knit of hierarchical code is well explained.

>From such an admirably solid base, Advanced proceeds from coverage of basic interfaces and functions which handle file and directory handling, the actual environment under which programs or rather processes run, through signals and threads to IPC, with an emphasis on sockets, and our terminal friends. Examples are prevalent throughout, and Advanced is anything if not thorough, with all arguments meticulously enumerated, and differences between the core four OSes pinned down in exquisite detail. Two detailed case studies make use of and enliven this material, the first being the implementation of an advanced database library, the second network printing under the common Internet Printing Protocol (IPP). An appendix references each of the standard ISO C and POSIX functions by way of function prototype which shows arguments, return value if any, necessary headers and most importantly a page reference for further material. It's a totally well rounded work which makes for an ideal reference and learning resource for those working at a low level coding highly portable, networked and threaded apps in C. The dry, schoolroom quality of much of the material may not be to everyone's taste, yet there's no denying that no other work of such meticulous detail exists.


Authors: Jonathan Corbet et al.
Publisher: O'Reilly
ISBN: 0596005903

Authors: W. Richard Stevens et al.
Publisher: Addison-Wesley
ISBN: 0201433074
Review by Martin Howse




Back to top