TechBookReport logo



Keywords: Unix, Linux, system programming, C programming

Title: Advanced Unix Programming

Author: Marc Rochkind

Publisher: Addison Wesley

ISBN: 0131411543

Media: Book

Level: Intermediate/Advanced

Verdict: A good place to start for existing C programmers who want to develop in Unix/Linux

The Unix landscape has changed beyond all recognition in the years since the first edition of this book appeared. In recognition of that fact Marc Rochkind has pretty much completely re-written his classic 'Advanced Unix Programming'. So don't be fooled by the fact that it's tagged as a 'second edition', this is effectively a new book with the same title. The Unix world is a lot more complicated now, both in terms of flavours (think Linux, BSD, Solaris, Mac OS X and so on), and also in terms of the sheer size of the kernel - the author states that the first edition covered around 70 system calls, this one covers more than 300.

The book aims to provide the competent C programmer a useful guide to the most important Unix system calls, across many of the different Unix-family platforms. This is a fairly ambitious undertaking and one that the author tackles by making extensive use of macro code. While this means the code is largely uncluttered, (and so, consequently, is the book), it does mean that anyone focused entirely on one platform might miss some of the subtleties that the macros hide. That isn't to say that platform differences aren't discussed, they are, it's just that the use of macros hides considerable complexity. However, without the use of macros it's certain that the code would have been a nightmare. Of course it helps that Rochkind explains why he's coded the way he has and makes the code available for download.

The book opens with a quick survey of the lay of the land, particularly in respect of POSIX and other standards, versions of Unix and coverage of the vexed topic of error handling (and the aforementioned macros). From then on it's straight into the core material - how to program Unix using system calls.

With so much material to cover the book looks at eight specific topics: File I/O, Advanced I/O, Terminal I/O, Processes and Threads, Basic Interprocess Communication, Advanced Interprocess Communication, Networking and Sockets and Signals and Timers. That's a lot of material to cover in one book, and Rochkind does a good job of it. The writing is to the point without being unnecessarily terse, and there are plenty of useful asides, anecdotes and snippets that add to the value of the book. While there's no in-depth knowledge of Unix assumed there is an assumption that the reader understands C programming. In that sense it's not a book that can be recommended to the beginning C hacker.

The sample code speaks for itself, and the book does include a number of more extensive examples, including a simple shell. Mention should also be made of two of the appendices. The first provides a C++ wrapper to the Unix system calls, enabling C++ programmers to make the most of the object oriented features of the language. A second appendix does the same for Java and Jython programmers using a library called Jtux.

For someone new to Unix programming and who is already fluent in C then this is a great place to start. It's demanding on the reader at times, but how else would you want it?


Hit the 'back' key in your browser to return to subject index page

Return to home page

Contents © TechBookReport 2005. Published April 6 2005