Addison-Wesley sent us in the hardcover second edition of the popular book title “Advanced Programming in the UNIX Environment” and we had a quick look at this classic.The book is written by well-known tech author W. Richard Stevens (famous for his TPC/IP Illustrated series) and Stephen A. Rago. Foreword is by the C creator, Dennis Ritchie.
On the second edition of this title the operating systems tested with the book’s samples have been multiplied. FreeBSD, Linux and Mac OS X are now part of the standard coverage in the 900+ book pages. The book starts off by explaining the Unix kernel in generic terms and continues with simple filesystem exercises. It goes on explaining the different implementations (ISO C, POSIX etc) and their differences. File I/O, permissions, buffering, atomic operations follow. After the I/O chapters, the book moves on to processes, signals, threads, deamons, networking, IPC, followed by explanation on how terminals work and their gotchas.
The book includes two ‘real life’ projects and implements them: a database library and communication with a network printer. Each of the projects includes a lot of printed code and schematics. The code is also available for downloading and I tested successfully some of it on my FreeBSD partition.
Towards the end of the book you will find a listing of function prototypes, explanation over more source code found throughout the book and solutions to some of the exercises of the book.
One thing that strikes you on all Stevens books is the clarity in which he describes the subjects. With some average C and Unix experience you can follow through easily and you can even jump a few chapters down the line and still follow up the book. While this book is not intended for C beginners, I am sure most people reading through it will “get” most of it and at least get a good idea about the underpinnings of Unix and/or Linux.
In conclusion, this is one of the best tech books ever published. It is the reference for Unix programming and it’s highly recommended. And what a great year this is for tech books: the new version of the ‘Dragon compiler book‘ is expected before December!
Buy “Advanced Programming in the UNIX Environment“